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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
It seems that f-strings aren't being correctly handled on python 3.12
For example, with this file:
#!/usr/bin/env python somedict = {"somekey": "example value"} print(f"{somedict['somekey']}")
This command:
unify example.py --check-only --quote '"'
Produces these invalid changes:
@@ -3,4 +3,4 @@ somedict = {"somekey": "example value"} -print(f"{somedict['somekey']}") +print(f"{somedict["somekey"]}")
Note that the tests are also failing (passing with 3.11):
====================================================================== FAIL: test_format_code (test_unify.TestUnitsWithFstrings.test_format_code) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/johnc/Projects/unify/test_unify.py", line 91, in test_format_code self.assertEqual("x = f'abc' \\\nf'next'\n", AssertionError: "x = f'abc' \\\nf'next'\n" != 'x = f"abc" \\\nf"next"\n' - x = f'abc' \ ? ^ ^ + x = f"abc" \ ? ^ ^ - f'next' ? ^ ^ + f"next" ? ^ ^ ====================================================================== FAIL: test_format_code_with_backslash_in_comment (test_unify.TestUnitsWithFstrings.test_format_code_with_backslash_in_comment) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/johnc/Projects/unify/test_unify.py", line 96, in test_format_code_with_backslash_in_comment self.assertEqual("x = f'abc' #\\\nf'next'\n", AssertionError: "x = f'abc' #\\\nf'next'\n" != 'x = f"abc" #\\\nf"next"\n' - x = f'abc' #\ ? ^ ^ + x = f"abc" #\ ? ^ ^ - f'next' ? ^ ^ + f"next" ? ^ ^ ----------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It seems that f-strings aren't being correctly handled on python 3.12
For example, with this file:
This command:
unify example.py --check-only --quote '"'
Produces these invalid changes:
Note that the tests are also failing (passing with 3.11):
The text was updated successfully, but these errors were encountered: