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

F504: Fails to converge if unused keys are concatenated string literals #4975

Closed
Tracked by #4972
addisoncrump opened this issue Jun 9, 2023 · 0 comments · Fixed by #4976
Closed
Tracked by #4972

F504: Fails to converge if unused keys are concatenated string literals #4975

addisoncrump opened this issue Jun 9, 2023 · 0 comments · Fixed by #4976
Assignees
Labels
bug Something isn't working

Comments

@addisoncrump
Copy link
Contributor

addisoncrump commented Jun 9, 2023

You can concatenate string literals like so: 'a' 'b' => 'ab'.

When F504 identifies an unused key which is defined with concatenated string literals, it fails to converge:

x = '' % {'a''b' : ''}
$ ruff concat-f504.py --no-cache --fix
debug error: Failed to converge after 100 iterations in `concat-f504.py` with rule codes F504:---
x = '' % {'a''b' : ''}

---
concat-f504.py:1:5: F504 `%`-format string has unused named argument(s): ab
Found 101 errors (100 fixed, 1 remaining).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants