-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
T: bugSomething isn't workingSomething isn't working
Description
Describe the bug
A Python file containing a single string assignment longer than the line length limit is not reformatted.
To Reproduce
Take long_line.py:
long = "This is a long line that is longer than 88 characters. I expect Black to shorten this line length."
Run Black:
$ black ./long_line.py
All done! ✨ 🍰 ✨
1 file left unchanged.
Expected behavior
I expect black to shorten the line length to less than the length limit. One possible solution is to break on the <line length limit minus 1> character and parenthesize if it is not already inside parentheses:
long = (
"This is a long line that is longer than 88 characters. I expect Black to shorten "
"this line length."
)
Environment (please complete the following information):
$ black --version
black, version 20.8b1
OS: macOS Catalina 10.15.6
$ python --version
Python 3.8.5
Does this bug also happen on master?
Yes
Additional context
None
Metadata
Metadata
Assignees
Labels
T: bugSomething isn't workingSomething isn't working