[flake8-pyi, ruff] Fix traversal of nested literals and unions (PYI016, PYI051, PYI055, PYI062, RUF041)#14641
Merged
AlexWaygood merged 4 commits intoastral-sh:mainfrom Nov 28, 2024
Conversation
Contributor
|
AlexWaygood
reviewed
Nov 27, 2024
Member
AlexWaygood
left a comment
There was a problem hiding this comment.
Thank you!! Most of the snapshot changes look great, but I spotted a couple of issues and I'm not sure I fully understand the changes you're making to the methods on SemanticModel
...src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.pyi.snap
Show resolved
Hide resolved
...src/rules/flake8_pyi/snapshots/ruff_linter__rules__flake8_pyi__tests__PYI055_PYI055.pyi.snap
Show resolved
Hide resolved
Contributor
Author
|
Thanks Alex! I'll pick this up tomorrow. |
5899085 to
b31732f
Compare
b31732f to
e3b0f5f
Compare
flake8-pyi, ruff] Fix traversal of nested literals and unions (PYI016, PYI051, PYI055, PYI062, RUF041)
ntBre
added a commit
that referenced
this pull request
Mar 11, 2025
Summary -- Stabilizes RUF041. The tests are already in the right place, and the docs look good. Test Plan -- 0 issues, 1 [PR] fixing nested literals and unions the day after the rule was added. No changes since then I wonder if the fix in that PR could be relevant for #16639, where I noticed a potential issue with `Union`. It could be unrelated, though. [PR]: #14641
ntBre
added a commit
that referenced
this pull request
Mar 12, 2025
Summary -- Stabilizes RUF041. The tests are already in the right place, and the docs look good. Test Plan -- 0 issues, 1 [PR] fixing nested literals and unions the day after the rule was added. No changes since then I wonder if the fix in that PR could be relevant for #16639, where I noticed a potential issue with `Union`. It could be unrelated, though. [PR]: #14641
MichaReiser
pushed a commit
that referenced
this pull request
Mar 13, 2025
Summary -- Stabilizes RUF041. The tests are already in the right place, and the docs look good. Test Plan -- 0 issues, 1 [PR] fixing nested literals and unions the day after the rule was added. No changes since then I wonder if the fix in that PR could be relevant for #16639, where I noticed a potential issue with `Union`. It could be unrelated, though. [PR]: #14641
MichaReiser
pushed a commit
that referenced
this pull request
Mar 13, 2025
Summary -- Stabilizes RUF041. The tests are already in the right place, and the docs look good. Test Plan -- 0 issues, 1 [PR] fixing nested literals and unions the day after the rule was added. No changes since then I wonder if the fix in that PR could be relevant for #16639, where I noticed a potential issue with `Union`. It could be unrelated, though. [PR]: #14641
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.
Summary
In previous work on PYI rules we found that the current traversal misses nested literals and unions.
These are rare but valid. As mentioned before, correctly handling these cases might be relevant for auto-generated stubs.
Test Plan
Added test cases in an earlier PR. Snapshots are updated and show nested literals and unions are now handled as expected.
No ecosystem changes.