We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flake8-typing-as-t
PyPI: https://pypi.org/project/flake8-typing-as-t/
This is a flake8 plugin which ensures that imports from the typing library must be written using import typing as t. TYT01: Bare import typing usage TYT02: import typing as X where X is not literal t TYT03: from typing import X usage
This is a flake8 plugin which ensures that imports from the typing library must be written using import typing as t.
flake8
typing
import typing as t
TYT01
import typing
TYT02
import typing as X
X
t
TYT03
from typing import X
TYT01 and TYT02 could be covered by ICN001 if the following config is added:
ICN001
[tool.ruff.flake8-import-conventions.extend-aliases] "typing" = "t"
but TYT03 is still valuable to have.
Another option is to extend flake-import-conventions to flag cases like
flake-import-conventions
from pandas import DataFrame # Use `import as pd` and `pd.DataFrame` instead
The text was updated successfully, but these errors were encountered:
My vote would be to find a way to enable this within the import conventions plugin since it's so closely related.
Sorry, something went wrong.
flake8-import-conventions
ICN003
from ... import ...
I've gone for a new ICN003 rule that bans from ... import ... for any configured modules
Successfully merging a pull request may close this issue.
PyPI: https://pypi.org/project/flake8-typing-as-t/
TYT01
andTYT02
could be covered byICN001
if the following config is added:but
TYT03
is still valuable to have.Another option is to extend
flake-import-conventions
to flag cases likeThe text was updated successfully, but these errors were encountered: