-
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
[flake8-type-checking
] Adds implementation for TC006
#14511
base: main
Are you sure you want to change the base?
Conversation
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
TC006 | 432 | 432 | 0 | 0 | 0 |
TC001 | 154 | 154 | 0 | 0 | 0 |
TC003 | 26 | 26 | 0 | 0 | 0 |
SIM115 | 2 | 1 | 1 | 0 | 0 |
E501 | 1 | 1 | 0 | 0 | 0 |
TC002 | 1 | 1 | 0 | 0 | 0 |
The extra hits for the other rules make sense to me, since fixing In the case of |
Now that
TCH
has been renamed toTC
and the redirect fromTCH006
toTCH010
can no longer bite us, I've added an implementation for this very simple rule.Summary
TC006
checks for non-string literal arguments totyping.cast
which adds unnecessary runtime overhead, since the function doesn't do anything at runtime.This PR has a very tiny overlap with my other PR for
TCH007
/TCH008
inflake8_type_checking/helpers.rs
for adding thequote_type_expression
function, but the two changes don't really depend on one another, so they can be merged in any order.Test Plan
cargo nextest run