diff --git a/doc/data/messages/u/useless-import-alias/bad.py b/doc/data/messages/u/useless-import-alias/bad.py new file mode 100644 index 0000000000..66c25dcc2d --- /dev/null +++ b/doc/data/messages/u/useless-import-alias/bad.py @@ -0,0 +1 @@ +import pandas as pandas # [useless-import-alias] diff --git a/doc/data/messages/u/useless-import-alias/details.rst b/doc/data/messages/u/useless-import-alias/details.rst new file mode 100644 index 0000000000..5b804e1e9c --- /dev/null +++ b/doc/data/messages/u/useless-import-alias/details.rst @@ -0,0 +1,8 @@ +Known issue +----------- + +If you prefer to use "from-as" to explicitly reexport in API (`from fruit import orange as orange`) +instead of using `__all__` this message will be a false positive. + +If that's the case use `pylint: disable=useless-import-alias` before your imports in your API files. +`False positive 'useless-import-alias' error for mypy-compatible explicit re-exports #6006 `_ diff --git a/doc/data/messages/u/useless-import-alias/good.py b/doc/data/messages/u/useless-import-alias/good.py new file mode 100644 index 0000000000..ffd919bcfb --- /dev/null +++ b/doc/data/messages/u/useless-import-alias/good.py @@ -0,0 +1 @@ +import pandas as pd diff --git a/doc/data/messages/u/useless-import-alias/related.rst b/doc/data/messages/u/useless-import-alias/related.rst new file mode 100644 index 0000000000..f195887420 --- /dev/null +++ b/doc/data/messages/u/useless-import-alias/related.rst @@ -0,0 +1,3 @@ +* `PEP 8, Import Guideline `_ +* `Pylint block-disable `_ +* `mypy --no-implicit-reexport `_