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

F523 should not be marked as always-fixable #4865

Closed
Tracked by #4972
addisoncrump opened this issue Jun 5, 2023 · 7 comments · Fixed by #4868
Closed
Tracked by #4972

F523 should not be marked as always-fixable #4865

addisoncrump opened this issue Jun 5, 2023 · 7 comments · Fixed by #4868
Labels
bug Something isn't working

Comments

@addisoncrump
Copy link
Contributor

It is possible to split a format invocation across multiple lines:

(''
.format(2))

This makes ruff a bit mad:

error: Failed to create fix for StringDotFormatExtraPositionalArguments: Failed to extract expression from source
fuzz/artifacts/ruff_fix_validity/minimized-from-f670b0a6b2f154ee6d66e9ad4f601cab0b3d4609:1:2: F523 `.format` call has unused arguments at position(s): 0
Found 1 error.

Discovered by #4822.

@charliermarsh
Copy link
Member

I believe this is a known issue in LibCST (that we filed): Instagram/LibCST#846. Going to close since we're mostly just waiting for it to be resolved upstream.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2023
@charliermarsh charliermarsh added the bug Something isn't working label Jun 5, 2023
@addisoncrump
Copy link
Contributor Author

Hm, okay. I will need to filter out this particular case in the fuzzers (to prevent the panic induced in code I didn't write 😅).

@charliermarsh
Copy link
Member

Gahhh haha sorry! That error is caught and handled, right? It doesn't actually panic, does it? It's supposed to be handled and logged to the user.

@addisoncrump
Copy link
Contributor Author

addisoncrump commented Jun 5, 2023

Yes, but when using the test suite functions, this panics (it is marked as always-fixable).

@charliermarsh
Copy link
Member

Oh, we should change it to "sometimes".

@addisoncrump
Copy link
Contributor Author

So, should we reopen with different title?

@charliermarsh
Copy link
Member

I'll just fix it real quick.

@addisoncrump addisoncrump changed the title F523: Newline between string and format invocation triggers extraction error F523 should not be marked as AlwaysFixed Jun 5, 2023
@addisoncrump addisoncrump changed the title F523 should not be marked as AlwaysFixed F523 should not be marked as always-fixable Jun 6, 2023
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