-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ruff
] Support slices in RUF005
#17078
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 |
---|---|---|---|---|---|
RUF005 | 22 | 22 | 0 | 0 | 0 |
Thank you. I think we should gate this change behind preview as it significantly expands the rule's scope (as demonstrated by the ecosystem results). Did you review the results from the ecosystem check? @ntBre do you want to review this change? |
@MichaReiser Sure, added a second commit to gate it as To my eye, the ecosystem changes look alright. |
@MichaReiser will do! @akx we squash and merge through GitHub, so no worries about squashing manually! |
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! I had one request about the test placement, but this otherwise looks good to me.
Summary
Teaches
RUF005
to also consider slices for concatenation. Other indexing (foo[0] + [7, 8, 9] + bar[1]
) is explicitly not considered.Test Plan
Manually tested (diff above from
ruff check --diff
), snapshot updated.