percent-format-extra-named-arguments
What it does
Section titled “What it does”Reports a % format applied to a dict that has keys that no placeholder names.
Why it matters
Section titled “Why it matters”Python ignores the extra keys without an error. The key is a leftover after the format string was edited, or a placeholder was misspelled and the value is never shown.
To fix, remove the key, or add the placeholder.
Example
Section titled “Example”..."%(x)s" % {"x": 1, "y": 2}...Configuration
Section titled “Configuration”python: lint: rules: percent-format-extra-named-arguments: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line percent-format-extra-named-arguments 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 | F504 |
full |