You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix for rule UP032 tried to replace instance of "some string literal".format with equivalent f-strings, by converting the string literal intro an f-string and placing the argument expression of format directly into the curly braces inside the f-string. This can cause a syntax error due to not all argument expressions being valid contents of curly braces within an f-string (at least until Python 3.12, where f-string parsing rules were updated, but I haven't checked). Specifically, f-strings such as f"{{0: 1}[0]}" are not valid.
Fix for rule UP032 tried to replace instance of
"some string literal".format
with equivalent f-strings, by converting the string literal intro an f-string and placing the argument expression offormat
directly into the curly braces inside the f-string. This can cause a syntax error due to not all argument expressions being valid contents of curly braces within an f-string (at least until Python 3.12, where f-string parsing rules were updated, but I haven't checked). Specifically, f-strings such asf"{{0: 1}[0]}"
are not valid.Snippet to reproduce:
command:
ruff snippet.py --select UP032 --isolated --fix
Ruff version:
ruff 0.1.8
Colab reproducing the issue:
https://colab.research.google.com/drive/1SHvTSAXxDeAoamaeOLe8nwatab4uyyM-?usp=sharing
The text was updated successfully, but these errors were encountered: