negate-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”... passx = not a == b...x = not a < bx = not a == b == c...... passx = a != b...x = not a < bx = not a == b == c...Configuration
Section titled “Configuration”python: lint: rules: negate-equal-op: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line negate-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 | SIM201 |
full |