Skip to content

Fix incorrect f-string tokenization#4332

Merged
JelleZijlstra merged 8 commits intopsf:mainfrom
JelleZijlstra:fix4329
Apr 25, 2024
Merged

Fix incorrect f-string tokenization#4332
JelleZijlstra merged 8 commits intopsf:mainfrom
JelleZijlstra:fix4329

Conversation

@JelleZijlstra
Copy link
Collaborator

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.

@tusharsadhwani
Copy link
Collaborator

Very clean!

@github-actions
Copy link

github-actions bot commented Apr 25, 2024

diff-shades reports zero changes comparing this PR (440009e) to main (ba88fc3).


What is this? | Workflow run | diff-shades documentation

@JelleZijlstra
Copy link
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.

@tusharsadhwani
Copy link
Collaborator

tusharsadhwani commented Apr 25, 2024

My workplace runs black for a lot of our customers, I will deploy the next release to catch any missing cases as well.

@hauntsaninja
Copy link
Collaborator

(no issues on my work codebase)

@JelleZijlstra
Copy link
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.

Copy link
Collaborator

@tusharsadhwani tusharsadhwani left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Black cannot parse previously parseable file in 24.4.1

3 participants