We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Original code:
query = ('type != {} OR ' "data::text = '{{}}'" .format(my_type))
$ ruff --isolated --select UP032 --preview rufftest/ruff_sample.py rufftest/ruff_sample.py:1:10: UP032 [*] Use f-string instead of `format` call $ ruff --isolated --select UP032 --preview rufftest/ruff_sample.py --fix Found 1 error (1 fixed, 0 remaining).
"Fixed" code:
query = (f'type != {my_type} OR ' "data::text = '{{}}'" )
Weird whitespace aside, the second string now contains a literal {{}} instead of the previous {} after formatting.
{{}}
{}
Any escaped {{}} format placeholders in string parts not converted to an f-string should be replaced with their unescaped version {}
The text was updated successfully, but these errors were encountered:
We just realized we hit the same bug in PyTorch with ruff a while back when we updated.
Sorry, something went wrong.
I thought this was filed before and fixed — will look into it!
Here's a failing test case #8697
f'"args": {{}}}}, ' is what broke for me.
f'"args": {{}}}}, '
Update UP032 to unescape curly braces in literal parts of converted s…
d1e88dc
…trings (#8697) Closes #8694
Successfully merging a pull request may close this issue.
Original code:
"Fixed" code:
Weird whitespace aside, the second string now contains a literal
{{}}
instead of the previous{}
after formatting.Any escaped
{{}}
format placeholders in string parts not converted to an f-string should be replaced with their unescaped version{}
The text was updated successfully, but these errors were encountered: