You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked with the online formatter that it is not fixed in the most up to date development branch.
Describe the bug
The following code has a line that is longer than 88 characters and yet is not split by black:
class LongNameLongName:
pass
class LongNameLongName2:
pass
class LongNameLongName3:
pass
class LongNameLongName4:
pass
class LongNameLongName5:
pass
class LongNameLongName6:
pass
class ClassWithTypeDefs:
name: str
field: LongNameLongName | LongNameLongName2 | LongNameLongName3 | LongNameLongName4 | LongNameLongName5 | LongNameLongName6
def func(
a: LongNameLongName
| LongNameLongName2
| LongNameLongName3
| LongNameLongName4
| LongNameLongName5
| LongNameLongName6,
):
pass
As can be seen, for a function black breaks the typing statement into multiple lines but not for the class definition.
$ flake8 --max-line-length 88 test.py
test.py:27:89: E501 line too long (127 > 88 characters)
$ black -l 88 -t py311 test.py
All done! ✨ 🍰 ✨
1 file left unchanged.
Expected behavior
black should break the line or at least not reformat the code to a line longer than the line width limit if the line was broken up before.
Environment
Linux
$ black --version
black, 23.7.0 (compiled: no)
Python (CPython) 3.11.4
The text was updated successfully, but these errors were encountered:
I have checked with the online formatter that it is not fixed in the most up to date development branch.
Describe the bug
The following code has a line that is longer than 88 characters and yet is not split by black:
As can be seen, for a function black breaks the typing statement into multiple lines but not for the class definition.
Expected behavior
black should break the line or at least not reformat the code to a line longer than the line width limit if the line was broken up before.
Environment
The text was updated successfully, but these errors were encountered: