Enable more Ruff PYI rules with autofixes - #12557
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
Avasam
commented
Aug 19, 2024
| # "PYI029", __str__ and __str__ sometimes have to be used for classes other than `object` | ||
| # Sometimes we still wanna be explicit about a default value nonetheless | ||
| # "PYI011", Also has false-positives with `_typeshed.sentinel` | ||
| # "PYI053", Also removes `Literal[{string_too_long}]` from an annotation |
Collaborator
Author
There was a problem hiding this comment.
We noqa that one twice in nanoid stubs for the paramether alphabet: str = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Ruff issue for the bad autofix in Literal: astral-sh/ruff#12995
Avasam
commented
Aug 21, 2024
Comment on lines
+50
to
51
| # avoids duplicate # noqa with flake8-pyi and flake8-noqa flagging `PYI` codes | ||
| # See https://github.com/plinss/flake8-noqa/issues/22 |
Collaborator
Author
There was a problem hiding this comment.
If anyone has a contact to @plinss , plinss/flake8-noqa#30 would be a nice flake8-noqa feature to get merged ^^"
JelleZijlstra
approved these changes
Aug 22, 2024
Collaborator
Author
|
Doesn't look like Ruff 0.6.2 added anything that should affect this ( |
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Collaborator
Author
|
Jelle approved 2 weeks ago and it's unchallenged. I'll merge it. If you see an issue, open a new PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added rules:
PYI014,PYI015,PYI030,PYI036,PYI044,PYI062I originally split this into 3 sections (
Fix is always available.,Fix is sometimes available., andWe sometimes noqa these), but I'm not sure if that's something worth doing, keeping it here for archiving purposes: