-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
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
Duplication and inconsistency between pep585 annotation rules: UP006, UP035 #15246
Comments
Updated information regarding It actually was not missing from
So, allowing this in py39 is just yet another problem with #5454 |
(At minimum we should definitely move |
Writing this related comment reminded me about another inconsistency: $ ruff --isolated check --target-version=py310 --select=UP006,UP035,F401 --preview test.py
|
Thanks. I reverted the change and published a bugfix release. |
Since ruff 0.8.5:
Example file
test.py
:Why do we have 2 different lints that warn us about the same thing?
Example file
test.py
:And why is this particular one not duplicated then?
Update: see next comment
Perhaps the pull request #5454 still has outstanding issues. It introduces duplication across the lints. It also introduces bugs in the fixer (see #15245).
In ruff 0.8.4 everything was working pretty well:
typing
that should be replaced with builtins likeList
->list
were covered byUP006
typing
that should be replaced withcollections.abc.*
were covered byUP035
.In ruff 0.8.5
collections.abc.*
is now covered by both of the lints.There was still a problem in Ruff 0.8.4 though:Callable
was not covered by any lint. But it should have just been added toUP035
and that's it. I'm not aware of any other omission. Instead it got added toUP006
but that still remains inconsistent per the above example.But I have to commend the pull request #5454 for how it is able to handle
typing.AbstractSet
->collections.abc.Set
:Example file
test.py
Ruff 0.8.4:
(fix not available)
Ruff 0.8.5:
Still duplicated warning:
But, it is able to automatically fix this!
File content after:
The text was updated successfully, but these errors were encountered: