Skip to content

percent-format-unsupported-format-character

Pythoncorrectnessno fixdefault: warnpython/ruff

Reports a % format with a conversion character that Python does not know, as in "%z" % x.

Python raises ValueError: unsupported format character when the line runs. It is usually a literal % that should have been written %%.

To fix, write %% for a percent sign, or a conversion Python has (s, r, a, d, i, f, x and so on).

Reported
a = b = c = 1
...
"%z" % a
...
python:
lint:
rules:
percent-format-unsupported-format-character: warn # off, warn (default), error

Enabled by the presets: python/ruff.

Suppress one line with sudsy-disable-next-line percent-format-unsupported-format-character 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 F509 full