Skip to content

new rule - fstring syntax in non-fstring #8151

@DetachHead

Description

@DetachHead
asdf = 1
"value is {asdf}" # the user probably meant to make this an f string

to avoid false positives, it should only complain when the expression inside the {} refers to an existing variable. that way, most usages of the format function won't trigger false positives:

x = "{foo}" # no error because `foo` variable does not exist
x.format(foo="bar")

Metadata

Metadata

Assignees

Labels

acceptedReady for implementationhelp wantedContributions especially welcomeruleImplementing or modifying a lint rule

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions