-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[flake8-simplify] Stabilize further simplification to binary expressions in autofix for if-else-block-instead-of-if-exp (SIM108)
#18506
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
Conversation
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| SIM108 | 13 | 8 | 5 | 0 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
2b24649 to
c6dc62f
Compare
|
The ecosystem checks are correct! The reason for the new lints is that the rule is skipped if the suggested replacement would exceed the configured maximum line length. Since we now suggest further simplifying to a binary expression, which is shorter, there are more possible places where the lint may trigger. Since I found this a bit surprising, I also updated the documentation to alert users to this point. |
crates/ruff_linter/src/rules/flake8_simplify/rules/if_else_block_instead_of_if_exp.rs
Show resolved
Hide resolved
c6dc62f to
8558cea
Compare
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
…sions in autofix for `if-else-block-instead-of-if-exp` (`SIM108`) (#18506)
No description provided.