-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
acceptedReady for implementationReady for implementationbugSomething isn't workingSomething isn't working
Description
See #1348 (comment).
Ruff doesn't detect Yoda conditions for the following:
x = ""
_ = x == "abc" or "def" == x
_ = "abc" == x or "def" == x
_ = "abc" == x or x == "def"Ruff doesn't output anything.
For comparison, Refurb outputs errors for each line:
$ refurb x.py
x.py:3:5 [FURB108]: Replace `x == y or z == x` with `x in (y, z)`
x.py:4:5 [FURB108]: Replace `x == y or z == y` with `y in (x, z)`
x.py:5:5 [FURB108]: Replace `x == y or y == z` with `y in (x, z)`
If you disable/don't fix the Yoda errors you won't get the PLR1714 errors. If you do fix the Yoda errors, you will get the proper/expected error, PLR1714.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedReady for implementationReady for implementationbugSomething isn't workingSomething isn't working