-
Notifications
You must be signed in to change notification settings - Fork 16
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
refactor: Create a common utility for looking up fully qualified names #194
base: main
Are you sure you want to change the base?
Conversation
This should make some checks a lot more robust and makes it easier to add similarly robust checks to library specific mixins.
Technically this implementation will allow fewer Either way this should be treated as a breaking change, but it's probably a good time for it anyways, we can drop 3.8 support and add 3.13 support at the same time. |
I added some basic handling for full name matching in the presence of star imports. I'm not fully convinced it's worth the extra complication yet, especially since they're an anti pattern and star imports may already break some of the other rules in subtle ways, we certainly don't have good test coverage for them. So I might revert this last commit again. |
Looks like ruff's current semantic model doesn't handle star imports, although I imagine they will support them, once they switch to red-knot as the backend. So I'm still neutral on adding this extra complication. |
Ruff also has a setting to specify additional typing modules, so we could do the same in order to still support vendored typing constructs (e.g. within a local compat module through |
This should make some checks a lot more robust and makes it easier to add similarly robust checks to library specific mixins.
This is also a precursor to using
is_typing
in the annotation visitor, so we can handle aliases and module level accesses ofLiteral
andAnnotated
.