Closed cclauss closed 1 year ago
IMPORTANT
Make your pull request against the dev branch, please!
dev
% ruff --select=SIM202 .
ruff --select=SIM202 .
2 SIM202 [*] Use `check_digit10(isbn10[:-1]) == isbn10[-1]` instead of `not check_digit10(isbn10[:-1]) != isbn10[-1]`
% ruff --select=SIM202 --fix .
ruff --select=SIM202 --fix .
Found 2 errors (2 fixed, 0 remaining).
% ruff rule SIM202
ruff rule SIM202
Derived from the flake8-simplify linter.
Autofix is always available.
Checks for negated != operators.
!=
Negated != operators are less readable than == operators, as they avoid a double negation.
==
not a != b
Use instead:
a == b
@xlcnd
IMPORTANT
Make your pull request against the
dev
branch, please!%
ruff --select=SIM202 .
%
ruff --select=SIM202 --fix .
%
ruff rule SIM202
negate-not-equal-op (SIM202)
Derived from the flake8-simplify linter.
Autofix is always available.
What it does
Checks for negated
!=
operators.Why is this bad?
Negated
!=
operators are less readable than==
operators, as they avoid a double negation.Example
Use instead:
References
@xlcnd