-
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-simplify
] Implement SIM911
#9460
Conversation
|
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.
Awesome, excited to review!
if checker.settings.preview.is_disabled() {
return;
} Ah yeah -- this shouldn't be required for rules that are in |
Thanks, corrected it. Double-checked my findings and it turns out that what I saw was actually a stable rule that had the preview check. I'm assuming that's still redundant? |
crates/ruff_linter/src/rules/flake8_simplify/rules/zip_dict_keys_and_values.rs
Outdated
Show resolved
Hide resolved
crates/ruff_linter/src/rules/flake8_simplify/rules/zip_dict_keys_and_values.rs
Outdated
Show resolved
Hide resolved
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.
Looks great! Only minor feedback.
Yeah, which rule is this? |
I checked to find the rule code only to realize it's just ONE OF the functions that has the preview check in which case it's probably fine 🤦♂️ forgive my silliness |
@trag1c - I'm happy to include this in today's release. Do you wanna do the follow-up feedback otherwise I can do it quickly (no bother either way)? |
Sure, let's get that released today! 😄 |
CodSpeed Performance ReportMerging #9460 will degrade performances by 4.35%Comparing Summary
Benchmarks breakdown
|
@trag1c - think it just needs to be updated against |
Head branch was pushed to by a user without write access
827747d
to
ea5a54a
Compare
My brain ignored "just pushed" and decided to update it myself either way 🤦♂️ |
(This doesn't touch the parser at all so it must be noise.) |
Summary
Closes #9319, implements the
SIM911
rule fromflake8-simplify
.Note
I wasn't sure whether or not to include
at the beginning of the function with violation logic if the rule's already declared as part of
RuleGroup::Preview
.I've seen both variants, so I'd appreciate some feedback on that :)