percent-format-star-requires-sequence
What it does
Section titled “What it does”Reports a % format with a * width or precision applied to a dict.
Why it matters
Section titled “Why it matters”A * takes its number from a tuple of values. Python raises TypeError: * wants int.
To fix, pass a tuple with the width before the value, or write the number in the format.
Example
Section titled “Example”..."%*s" % {"x": 1}"%s" % a"%s %s" % (*a,)"%(x)s" % {"x": 1, **a}...Configuration
Section titled “Configuration”python: lint: rules: percent-format-star-requires-sequence: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line percent-format-star-requires-sequence 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 | F508 |
full |