-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix incorrect f-string tokenization #4332
Conversation
Very clean! |
@hauntsaninja would you mind trying this branch on your codebase to see if there are any crashes or reformattings? I tried on my company codebase, on pyomo (where the bug report came from), and on a venv full of packages and found no issues. |
My workplace runs black for a lot of our customers, I will deploy the next release to catch any missing cases as well. |
(no issues on my work codebase) |
Great, thanks! @tusharsadhwani or @hauntsaninja do you think you have time to do a review? If not, I'll merge this PR tonight my time and cut a new release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfectly good to me. Appreciate the documentation as well!
Fixes #4329
I didn't understand how the f-string state machine worked, so I made the state more explicit and now it seems to work. I'll want to try it on more real-world code before merging this though.