-
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-bugbear
] Add fix for duplicate-value
(B033
)
#9510
Conversation
58e9888
to
d07dcbb
Compare
CodSpeed Performance ReportMerging #9510 will not alter performanceComparing Summary
|
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLC0415 | 14 | 14 | 0 | 0 | 0 |
PLR0917 | 8 | 8 | 0 | 0 | 0 |
PLR6201 | 6 | 6 | 0 | 0 | 0 |
B033 | 2 | 0 | 0 | 2 | 0 |
PLR0904 | 1 | 1 | 0 | 0 | 0 |
F841 | 1 | 1 | 0 | 0 | 0 |
E721 | 1 | 1 | 0 | 0 | 0 |
PLR0914 | 1 | 1 | 0 | 0 | 0 |
ac694f5
to
ec40f0a
Compare
ec40f0a
to
b574c93
Compare
range: TextRange::default(), | ||
})), | ||
range, | ||
)); |
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.
I would prefer to do something similar to remove_argument
, if possible, since the generator-based approach will lose comments. Are you open to trying that?
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.
Seems like remove_argument
is strictly for ExprCall
s and associated Arguments
, unsure if it'd work to cast everything over.
All usages of remove_argument
come from actual ExprCall
s, and we're working with a vector of Expr
here from a set.
Please advise! 🙏🏽
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.
Oh sorry, I meant, like, writing a new method that removes an element from a comma-separated collections, but based on the token stream, similar to remove_argument
.
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.
Ahh. I'll see what I can do!
Tweaked accordingly. The new function is not special to this set implementation, and could be placed into the I feel like this rule could also be expanded to work on |
0821654
to
260ad1d
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.
Thanks!
B033
flake8-bugbear
] Add fix for duplicate-value
(B033
)
Woop, left dead code in there facepalm Thanks Charlie! |
No it's all good, I just realized that with the revised fix implementation, we could revert back to the previous structure! |
Had to move this under preview since we're not supposed to add safe fixes outside of preview (this is gonna change in the next minor release though, and we'll elevate this out of preview). |
Summary
Adds autofix for B033
Test Plan
cargo test