percent-format-invalid-format
What it does
Section titled “What it does”Reports a "..." % x whose format string does not parse, such as a % at the end of the string.
Why it matters
Section titled “Why it matters”Python raises ValueError: incomplete format when the line runs, so the failure is at run time and only on the path that reaches the line.
To fix, escape a literal percent sign as %%, or complete the conversion.
Example
Section titled “Example”a = b = c = 1"%" % a...Configuration
Section titled “Configuration”python: lint: rules: percent-format-invalid-format: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line percent-format-invalid-format 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 | F501 |
full |