-
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
[flake8-pyi
, ruff
] Fix traversal of nested literals and unions (PYI016
, PYI051
, PYI055
, PYI062
, RUF041
)
#14641
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Thanks Alex! I'll pick this up tomorrow. |
5899085
to
b31732f
Compare
b31732f
to
e3b0f5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!
flake8-pyi
, ruff
] Fix traversal of nested literals and unions (PYI016
, PYI051
, PYI055
, PYI062
, RUF041
)
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.