Fix incorrect f-string tokenization#4332
Merged
JelleZijlstra merged 8 commits intopsf:mainfrom Apr 25, 2024
Merged
Conversation
Collaborator
|
Very clean! |
Collaborator
Author
|
@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. |
Collaborator
|
My workplace runs black for a lot of our customers, I will deploy the next release to catch any missing cases as well. |
Collaborator
|
(no issues on my work codebase) |
Collaborator
Author
|
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. |
tusharsadhwani
approved these changes
Apr 25, 2024
Collaborator
tusharsadhwani
left a comment
There was a problem hiding this comment.
Looks perfectly good to me. Appreciate the documentation as well!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.