Skip to content
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

Preview style incorrectly removes parens from walrus in annotation #3419

Closed
JelleZijlstra opened this issue Dec 10, 2022 · 0 comments · Fixed by #3423
Closed

Preview style incorrectly removes parens from walrus in annotation #3419

JelleZijlstra opened this issue Dec 10, 2022 · 0 comments · Fixed by #3423
Labels
T: bug Something isn't working

Comments

@JelleZijlstra
Copy link
Collaborator

$ black -c 'def this_is_so_dumb() -> (please := no): ...'
def this_is_so_dumb() -> (please := no):
    ...
$ black --preview -c 'def this_is_so_dumb() -> (please := no): ...'
def this_is_so_dumb() -> (please := no): ...
error: cannot format <string>: Cannot parse: 1:32: def this_is_so_dumb() -> please := no:
$ black --version
black, 22.12.0 (compiled: yes)
Python (CPython) 3.9.14

Found this in CI for #3418, cf. #3407.

Seems like a result of #2990, cc @jpy-git.

Broader learning: for all stable style tests, we should run tests in preview style that assert that formatting at least succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
1 participant