-
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
RUF028 - Flag unused variables in tuple unpacking. #9936
Conversation
CodSpeed Performance ReportMerging #9936 will not alter performanceComparing Summary
|
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
RUF028 | 327 | 327 | 0 | 0 | 0 |
Thanks for opening this PR and I'm sorry that it took us so long to get back to you. We discussed this rule internally, and we haven't come to an agreement if it's the right call to split I prefer not to merge this PR today because we lack that agreement. I would rather keep the status quo than change the rule and risk having to change it back in a few months. I'm sorry that we gave the wrong impression and that it took us so long to get back to you. Thanks again for your work. |
Related to #8884
Summary
It was suggested in #8884 that we have a separate rule for tuple unpacking. There was a bit of back and forth so I wasn't sure what the final requirements were. The following is what I went with:
Requirements implemented:
Things I was unsure of:
a, b = c, d = foo()
and onlya
is used,c
andd
will be flagged for a fix. But in #8884 it was mentioned that this new rule should only flag if the entire tuple is unused. Since thec, d
tuple is entirely unused, should it be ignored in this rule?Test Plan
cargo test