-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False negatives on PYI rules #8771
Comments
(Some of these are due to recent changes we've made in flake8-pyi -- e.g. the violations on lines 18-20 are because we recently extended our type alias rules to cover type aliases created using PEP-695 type statements.) |
Thank you! |
## Summary Part of #8771. flake8-pyi will emit a Y018 error for unused TypeVars, ParamSpecs or TypeVarTuples; Ruff currently only emits PYI018 for unused TypeVars. This is my first "proper" Ruff PR -- let me know if there's a better way of doing this! Not sure if the repeated calls to `match_typing_expr()` are ideal. ## Test Plan I manually updated the fixtures to add some unused ParamSpecs and TypeVarTuples, and then updated the snapshots using `cargo insta review`. All tests then passed when run using `cargo test`.
## Summary Fixes one of the issues listed in #8771. Fairly straightforward! ## Test Plan `cargo test` / `cargo insta review`
## Summary Fixes another of the bullet points from #8771 ## Test Plan `cargo test` / `cargo insta review`
All but one of these are now ticked off 🥳 I'm closing this now, since the last one is sort-of in a category by itself, and I'm not sure we'd want to fix it. The obvious way to teach ruff to recognize |
Ruff reports no errors on the following code snippet (saved as a
.pyi
stub file) with the commandruff --select=PYI
, whereas flake8-pyi reports quite a few ;)If I run
flake8 --extend-ignore=Y023,Y031,Y037
on the same file (with the latest version of the flake8-pyi installed), it reports the following violations:TODO:
mypy_extensions.TypedDict
rather thantyping.TypedDict
ortyping_extensions.TypedDict
*args
and**kwargs
annotated usingtyping.NoReturn
The text was updated successfully, but these errors were encountered: