You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ruff --versionruff 0.4.10
$ ruff check --isolated --select PLR1714 test.py test.py:4:8: PLR1714 Consider merging multiple comparisons: `b in ('2', '3')`. Use a `set` if the elements are hashable.Found 1 error.No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).
$ ruff check --isolated --select PLR1714 --fix --unsafe-fixes test.py Found 1 error (1 fixed, 0 remaining).
Now the contents of test.py is shown below, where the conditional a == 1 has been removed.
defPLR1714_demo():
a=1b='2'ifbin ('2', '3'):
pass
The text was updated successfully, but these errors were encountered:
Ruff removes the
a == 1
condition in the example below when applying the (unsafe) auto-fix.Consider this source as test.py:
Then:
Now the contents of test.py is shown below, where the conditional
a == 1
has been removed.The text was updated successfully, but these errors were encountered: