Skip to content

UP031 not violated for variables, only literal values #10187

Closed
@lev-blit

Description

UP031 (printf-string-formatting, suggests using str.format instead of percent formatting) doesn't trigger when using a variable and not a literal value.

Even using the example from the docs -

value = 1
print("%s" % value)  # seems to be OK

print("%s" % 1)  # violating UP031

I've tried this out in the rust playground as well (here's an example) with version 0.3.0, selecting all UP rules

Metadata

Assignees

Labels

good first issueGood for newcomersruleImplementing 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