-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement flake8-use-fstring
#2097
Comments
I believe we support FS001 and FS002, at least partially, as UP031 and UP032, which also automatically upgrade (I say "partially", because it doesn't flag every usage of |
We could change UP031 and UP032 to always flag those string formatting methods, even if they can't fix them. That'd be one way to close out this issue. But it's a bit of a behavior change for those rules. |
Let me test how it works right now, looking at the rules description, it might actually be enough. |
@charliermarsh Sorry for necro'ing a closed issue - just want to mention that in my recent usage, UP032 did indeed left some |
https://github.com/MichaelKim0407/flake8-use-fstring
FS001
:%
formatting is used.FS002
:.format
formatting is used.FS003
: f-string missing prefix (ignored by default).Config options:
--percent-greedy
,--format-greedy
Level 0 (default): only report error if the value before
%
or.format
is a string literal.Level 1: report error if a string literal appears before
%
or.format
anywhere in the statement.Level 2: report any usage of
%
or.format
.The text was updated successfully, but these errors were encountered: