MNT: Enforce ruff/Pyflakes rules (F)#27309
Conversation
dcc1d0d to
e5dda5d
Compare
dfcd46a to
bd85509
Compare
|
I'm getting circular imports trying to address ruff suggestions. |
c733263 to
b33b2af
Compare
jorenham
left a comment
There was a problem hiding this comment.
I noticed that there are a lot of F401 (unused-import) ignores. Maybe we should just disable it structurally, e.g. for all __init__.py in the lint.extend-per-file-ignores?
|
In numtype I've been using nested (hierarchical) extend = "../../../pyproject.toml"
line-length = 88
[lint]
extend-ignore = [
"D", # pydocstyle
"ERA", # eradicate
"S", # flake8-bandit
"T", # flake8-print
"PLR2004", # pylint: magic-value-comparisons
]Perhaps something like that could also help for numpy? |
|
The amount of per file ignores remains limited for now. I suggest we revisit hierarchical |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure how to use mypy_primer, there weren't too many typing-related changes here. I have rebased just in case. |
This comment has been minimized.
This comment has been minimized.
https://github.com/pytorch/vision/blob/main/torchvision/utils.py#L271 🤷🏻 |
|
Rebased to fix conflicts. |
|
needs another rebase |
|
Rebased to fix conflicts. |
|
Rebased. |
it needs another, I'm afraid |
imported but unused
Redefinition of unused function
Undefined name in `__all__`
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
imported but unused
|
Rebased. |
|
Thanks Dimitri |
In preparation for #24994.The purpose of this PR is to show the kind of changes involved byFrules, because ruff enablesFrules by default.The idea is not necessarily to apply these rules. Rather I would like to start a discussion whether it we should apply or disable theseFrules, if pycodestyle was replaced by ruff.Now that we have switched to ruff, try to enable Pyflakes
Frules.I have left out F821. Relevant changes involve circular imports and extensive changes. This is best left to a future PR.