f-string
What it does
Section titled “What it does”Reports a "...".format(...) call on a string literal whose fields all name an argument.
Why it matters
Section titled “Why it matters”An f-string puts the expression where it is shown, so the reader does not look from the field to the argument list and count positions. It is also the faster form.
To fix, write an f-string.
Example
Section titled “Example”...
...
x = "{}".format(y)
...Configuration
Section titled “Configuration”python: lint: rules: f-string: warn # off (default), warn, errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line f-string 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 | UP032 |
full |