Skip to content
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

spot pointless f-strings? #3

Closed
peterjc opened this issue Jan 12, 2020 · 1 comment
Closed

spot pointless f-strings? #3

peterjc opened this issue Jan 12, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@peterjc
Copy link
Owner

peterjc commented Jan 12, 2020

See flake8-pie's PIE782 code, since disabled due to false positives:

sbdchd/flake8-pie#24

The idea is to treat things like the following as a special case:

print(f"Hello world!")

In that example the f-prefix can be omitted, a plain string literal is enough:

print("Hello world!")
@peterjc
Copy link
Owner Author

peterjc commented Nov 2, 2023

This is covered by flake8 F541 since pyflakes 2.2.0 (released 2020-04-08).

This is also available in ruff https://docs.astral.sh/ruff/rules/f-string-missing-placeholders/

@peterjc peterjc closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant