break-outside-loop
What it does
Section titled “What it does”Reports a break that no loop of its function or class contains.
Why it matters
Section titled “Why it matters”Python rejects the file with SyntaxError: 'break' outside loop, so no code in it runs.
To fix, remove the break, or put the statement in the loop it is meant for. In a function, return leaves it.
Example
Section titled “Example”...x = 1...
break...Configuration
Section titled “Configuration”python: lint: rules: break-outside-loop: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line break-outside-loop 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 | F701 |
full |