f-string-missing-placeholders
What it does
Section titled “What it does”Reports an f-string that has no replacement field in any of its parts.
Why it matters
Section titled “Why it matters”The f prefix does nothing without a {}, and it suggests that a value was meant to be put in. It is often a placeholder that was lost in an edit.
To fix, remove the f, or add the field.
Example
Section titled “Example”x = b = 1f"text"f"{x}"f"a" f"{b}""plain"f"{{}}"Configuration
Section titled “Configuration”python: lint: rules: f-string-missing-placeholders: warn # off, warn (default), errorEnabled by the presets: python/ruff.
Suppress one line with sudsy-disable-next-line f-string-missing-placeholders 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 | F541 |
full |