Black doesn't wrap long line but wraps shorter line #2548
Labels
F: linebreak
How should we split up lines?
F: linetoolong
Black makes our lines too long
F: strings
Related to our handling of strings
T: bug
Something isn't working
Describe the bug
Black fixes line with length of 120 but doesn't fix line with length of 152. When i tried to fix it myself Black reverted my changes.
To Reproduce
-l 100 -S
Expected behavior
Black should format this code as:
Environment (please complete the following information):
Does this bug also happen on main?
Yes.
Additional context
When you format this code Black wraps both lines correct:
I think this happens because black cannot split f-string into parts and so it can not make line shorter than 100 symbols, so it leaves this line unchanged. But in that case, Black should NOT discard my manual changes to this line and make it longer, or black should try to make line as short as possible even when it still longer than
--line-length
The text was updated successfully, but these errors were encountered: