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

Review WPS305 (f-string found violation) inclusion #3308

Open
Sxderp opened this issue Feb 12, 2025 · 3 comments
Open

Review WPS305 (f-string found violation) inclusion #3308

Sxderp opened this issue Feb 12, 2025 · 3 comments
Labels
bug Something isn't working documentation Docs related task

Comments

@Sxderp
Copy link
Contributor

Sxderp commented Feb 12, 2025

https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/violations/consistency.html#wemake_python_styleguide.violations.consistency.FormattedStringViolation

The violation has been removed because "ruff covers this rule." However, I can't find a ruff rule that actually covers it. There are ruff rules that do the opposite (perfer f-string over format).

Am I missing something? Which rule should I be enabling to get similar behavior?

https://docs.astral.sh/ruff/rules/

@Sxderp Sxderp added the rule request Adding a new rule label Feb 12, 2025
@sobolevn
Copy link
Member

Yeah, sorry, the violation description is confusing. I changed the default from .format to f string, because ruff does not allow to use .format :(

I am open to suggestions on how to better document it.
If you really want this, you can port the old rule to your custom flake8 plugin and use it.

@sobolevn sobolevn added bug Something isn't working documentation Docs related task and removed rule request Adding a new rule labels Feb 12, 2025
@Sxderp
Copy link
Contributor Author

Sxderp commented Feb 12, 2025

Ruff "by default" does not allow the use of .format. I think you could keep the violation in WPS and publish a doc with "known ruff incompatibilities" that lists incompatible rules and each project can decide what they want. Ruff has already set a precedent of including conflicting rules that end-users have to decide on.

Example: D203 / D211

@MehrazRumman
Copy link

can you assign me this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Docs related task
Projects
None yet
Development

No branches or pull requests

3 participants