multiple-statements-on-one-line-colon
What it does
Section titled “What it does”Reports a compound statement whose body starts on the line of its colon, as in if x: y(). def and a lone ... as the body are not reported.
Why it matters
Section titled “Why it matters”The body is easy to miss when it sits at the end of a long line, and a line breakpoint or coverage mark on the line cannot tell the condition from the body.
To fix, put the body on its own indented line.
Example
Section titled “Example”...
... if x: pass...
...Configuration
Section titled “Configuration”python: lint: rules: multiple-statements-on-one-line-colon: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line multiple-statements-on-one-line-colon 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 | E701 |
full |