Skip to content

continue-outside-loop

Pythoncorrectnessno fixdefault: warnpython/ruff

Reports a continue that no loop of its function or class contains.

Python rejects the file with SyntaxError: 'continue' not properly in loop, so no code in it runs.

To fix, remove the continue, or put the statement in the loop it is meant for.

Reported
...
...
continue
...
...
python:
lint:
rules:
continue-outside-loop: warn # off, warn (default), error

Enabled by the presets: python/ruff.

Suppress one line with sudsy-disable-next-line continue-outside-loop in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
ruff F702 full