-
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
Crash with preview style + line length 1 #4062
Comments
Correction: This is due to |
Looked into this a little today but couldn't find a fix. This variant of the test case is more effective: |
I'll try looking at it. It's a shame that this didn't get caught at the time, since |
I did put some logic in the test suite that runs all tests in a couple of modes and looks for crashes, but it might not do the combination |
Lines 126 to 128 in 3416b2c
|
undoing that exception brings up two failing cases, fmtskip2 and comments2. Dug into comments2 a little bit and it was turning a = "type comment with trailing space" # type: str into a = (
"type comment with trailing space"
) and losing the type comment. Did not look at the other one, but could maybe split those out into separate files and mark them as vulnerable to line-length, or fiddle with the |
Oops, I totally forgot I wrote that comment :). Yes, it would be good to put some mechanism in that lets us run |
On Black 23.11.0:
Works without preview:
You can also make it crash with a slightly more reasonable line length if you make the identifiers longer:
You can see with
--fast
why it crashes: it puts an illegal newline after the->
:This is from the
parenthesize_long_type_hints
preview feature (#3899).The text was updated successfully, but these errors were encountered: