Repository navigation
Avoid dropping extra boolean operations in repeated-equality-comparison - #12368
Merged
Merged
Conversation
charliermarsh
force-pushed
the
charlie/PLR1714
branch
2 times, most recently
from
July 17, 2024 15:35
72bca7f to
420f885
Compare
Contributor
|
| 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
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.
KotlinIsland
pushed a commit
to KotlinIsland/basedpython
that referenced
this pull request
May 1, 2026
## 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 astral-sh/ruff#7797.
I think this logic was _probably_ added because of
astral-sh/ruff#12368 -- the intent being that
we'd replace the _entire_ expression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #12062.