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
Black removes line breaks if I insert them myself (See expected behaviour section).
Running black formatter with explicit line length:
python3.8 -m black test_line_lenght.py --line-length 88
All done! ✨ 🍰 ✨
1 file left unchanged.
Pylint reports line exceeding length:
python3.8 -m pylint test_line_lenght.py --disable=missing-module-docstring,missing-function-docstring,unused-argument,missing-function-docstring,invalid-name,missing-class-docstring
************* Module test_line_lengh
test_line_lenght.py:24:0: C0301: Line too long (108/88) (line-too-long)
------------------------------------------------------------------
Your code has been rated at 8.89/10 (previous run: 8.89/10, +0.00)
Expected behavior
Black should insert line break on line exceeding 88 characters.
My interpretation it should look like this based on PEP8:
The last case is a duplicate of #510 (attribute chains). You mention various other cases, but those should get specific issues in the
F: linetoolongBlack makes our lines too long
label.
Describe the bug
Black does not break lines containing class member access even though character line limit is exceeded.
To Reproduce
Given this code using dataclasses with long member names:
Black removes line breaks if I insert them myself (See expected behaviour section).
Running black formatter with explicit line length:
python3.8 -m black test_line_lenght.py --line-length 88 All done! ✨ 🍰 ✨ 1 file left unchanged.
Pylint reports line exceeding length:
python3.8 -m pylint test_line_lenght.py --disable=missing-module-docstring,missing-function-docstring,unused-argument,missing-function-docstring,invalid-name,missing-class-docstring ************* Module test_line_lengh test_line_lenght.py:24:0: C0301: Line too long (108/88) (line-too-long) ------------------------------------------------------------------ Your code has been rated at 8.89/10 (previous run: 8.89/10, +0.00)
Expected behavior
Black should insert line break on line exceeding 88 characters.
My interpretation it should look like this based on PEP8:
If manually applying this refactoring, black will revert so this assignment is a one-liner again.
Environment
Additional context
Similar issue on line breaks #1802 recommends using
--experimental-string-processing
which does not solve this issue.I frequently use nested dataclasses in my projects and i run into this issue every now and then because pylint reports line-too-long errors.
The text was updated successfully, but these errors were encountered: