Describe the bug When there's a docstring that's near the max line length with the """ on the next line, the new version of Black moves the """ to the first line, making the line too long.
To Reproduce Steps to reproduce the behavior:
-
Create a file with this content:
def my_func():
"""Remove punctuation and return cleaned string plus its length in tokens.
"""
pass
-
Reformat it
-
Note that it now has the docstring on one line and that that line has 82 chars:
def my_func():
"""Remove punctuation and return cleaned string plus its length in tokens."""
pass
Expected behavior
The docstring shouldn't get wrapped.
Environment (please complete the following information):
Does this bug also happen on master? To answer this, you have two options:
Yes: https://black.now.sh/?version=master&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AC3AIldAD2IimZxl1N_WlbvK5V-ga8lyrVzgK48mW1g5y7ZvjbGhEN7nG-8hLA9oQ3I4FUxivNyD3Gy0_4fbH0Mg7-k28ZpTZzLozFMvMFSuDJT_0ZQmFpNZw6AAvoHjtKEQjGQksHXW1WBInIzl_HhTgRlCs-04wcVCEBY4OInuM5XhKBPO4ZIAzTqLcpeAAAAADHge2pSp2OmAAGlAbgBAAByceBuscRn-wIAAAAABFla
Describe the bug When there's a docstring that's near the max line length with the
"""on the next line, the new version of Black moves the"""to the first line, making the line too long.To Reproduce Steps to reproduce the behavior:
Create a file with this content:
Reformat it
Note that it now has the docstring on one line and that that line has 82 chars:
Expected behavior
The docstring shouldn't get wrapped.
Environment (please complete the following information):
Version: [e.g. master] 20.8b1
OS and Python version:
Linux/Python 3.8.2
Does this bug also happen on master? To answer this, you have two options:
Yes: https://black.now.sh/?version=master&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4AC3AIldAD2IimZxl1N_WlbvK5V-ga8lyrVzgK48mW1g5y7ZvjbGhEN7nG-8hLA9oQ3I4FUxivNyD3Gy0_4fbH0Mg7-k28ZpTZzLozFMvMFSuDJT_0ZQmFpNZw6AAvoHjtKEQjGQksHXW1WBInIzl_HhTgRlCs-04wcVCEBY4OInuM5XhKBPO4ZIAzTqLcpeAAAAADHge2pSp2OmAAGlAbgBAAByceBuscRn-wIAAAAABFla