unnecessary-placeholder
What it does
Section titled “What it does”Reports a pass or ... statement in a body that has two statements or more.
Why it matters
Section titled “Why it matters”pass and ... stand for “nothing here”. Next to other statements they only suggest that something was removed.
To fix, delete the statement.
Example
Section titled “Example”...x = a.startswith("a") and a.startswith("b")x = a.startswith("a") or a.endswith("b")if a: pass passelse: ... x = 1
def f(): """doc""" ...
class C:...Configuration
Section titled “Configuration”python: lint: rules: unnecessary-placeholder: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line unnecessary-placeholder 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 | PIE790 |
full |