string-dot-format-mixing-automatic
What it does
Section titled “What it does”Reports a .format string that has both automatic fields ({}) and numbered ones ({0}).
Why it matters
Section titled “Why it matters”Python raises ValueError: cannot switch from automatic field numbering to manual field specification when the line runs.
To fix, use one kind of field in a string.
Example
Section titled “Example”a = b = c = 1..."{} {0}".format(a)...Configuration
Section titled “Configuration”python: lint: rules: string-dot-format-mixing-automatic: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line string-dot-format-mixing-automatic 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 | F525 |
full |