Skip to content
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

Avoid dropping extra boolean operations in repeated-equality-comparison #12368

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Closes #12062.

@charliermarsh charliermarsh added the bug Something isn't working label Jul 17, 2024
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 53 projects unchanged)

bokeh/bokeh (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

- src/bokeh/sphinxext/bokeh_sampledata_xref.py:180:16: PLR1714 Consider merging multiple comparisons: `node.subfolder in ('all', sp[-2])`. Use a `set` if the elements are hashable.

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR1714 1 0 1 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 53 projects unchanged)

bokeh/bokeh (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- src/bokeh/sphinxext/bokeh_sampledata_xref.py:180:16: PLR1714 Consider merging multiple comparisons: `node.subfolder in ('all', sp[-2])`. Use a `set` if the elements are hashable.

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
PLR1714 1 0 1 0 0

@charliermarsh charliermarsh merged commit 72e0220 into main Jul 17, 2024
38 of 39 checks passed
@charliermarsh charliermarsh deleted the charlie/PLR1714 branch July 17, 2024 15:49
charliermarsh added a commit that referenced this pull request Jul 18, 2024
## Summary

This PR allows us to fix both expressions in `foo == "a" or foo == "b"
or ("c" != bar and "d" != bar)`, but limits the rule to consecutive
comparisons, following #7797.

I think this logic was _probably_ added because of
#12368 -- the intent being that
we'd replace the _entire_ expression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: PLR1714 auto-fix with multiple conditions
1 participant