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
def foo(a):
""" This is fine. """
return a + 1
def bar(a):
"""As is this."""
return a + 1
def baz(a):
""" This is not.
Since it uses more than one line. """
return a + 1
Running black --diff test.py results in a diff of:
@@ -9,10 +9,10 @@
return a + 1
def baz(a):
- """ This is not.
+ """This is not.
- Since it uses more than one line. """
+ Since it uses more than one line."""
return a + 1
Expected behavior
Black should also complain that the docstring of foo contains a leading / trailing space and remove these. Note that all one-line examples in PEP 257 https://www.python.org/dev/peps/pep-0257/#one-line-docstrings have no leading / trailing spaces.
Environment (please complete the following information):
Version: master
OS: Linux (Ubuntu 20.04)
Python Version: Python 3.8.2
Does this bug also happen on master?
This also happens on master.
The text was updated successfully, but these errors were encountered:
#1740)
Fixes#1738. Fixes#1812.
Previously, Black removed leading and trailing spaces in multiline docstrings but failed to remove them from one-line docstrings.
With the file
test.py
containingRunning
black --diff test.py
results in a diff of:Expected behavior
Black should also complain that the docstring of foo contains a leading / trailing space and remove these. Note that all one-line examples in PEP 257 https://www.python.org/dev/peps/pep-0257/#one-line-docstrings have no leading / trailing spaces.
Environment (please complete the following information):
Does this bug also happen on master?
This also happens on master.
The text was updated successfully, but these errors were encountered: