negate-not-equal-op
What it does
Section titled “What it does”Reports not applied to a comparison with !=, as in not a != b.
Why it matters
Section titled “Why it matters”== is the operator for that, and it reads without the reader inverting the comparison.
To fix, write a == b.
Example
Section titled “Example”... pass...x = not a != bx = not a < bx = not a == b == c...... pass...x = a == bx = not a < bx = not a == b == c...Configuration
Section titled “Configuration”python: lint: rules: negate-not-equal-op: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line negate-not-equal-op in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| ruff | SIM202 |
full |