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
Please see the below Python snippet, I am using Python 3.11 with docformatter==1.7.5:
# a.pydeffoo() ->None:
"""I am a first sentence this long. I am another sentence that I would like to be in summary."""
Running docformatter --black --close-quotes-on-newline a.py formats it to:
# a.pydeffoo() ->None:
""" I am a first sentence this long. I am another sentence that I would like to be in summary. """
I understand why the summary line is being split, because it violates the 88-char summary wrap length. However, I would like docformatter to avoid splitting the summary into a description like so:
# a.pydeffoo() ->None:
""" I am a first sentence this long. I am another sentence that I would like to be in summary. """
I think what this warrants is:
New arg --no-split-summary-description or --no-split-first-sentence
Or a new regex to split the first sentence with, which can be set to \n
The text was updated successfully, but these errors were encountered:
Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description.
And and one-line docstring, per PEP-257:
The docstring is a phrase ending in a period. It prescribes the function or method’s effect as a command (“Do this”, “Return that”), not as a description; e.g. don’t write “Returns the pathname …”.
The example you provide is a multi-line docstring per PEP-257 and is being handled appropriately.
Please see the below Python snippet, I am using Python 3.11 with
docformatter==1.7.5
:Running
docformatter --black --close-quotes-on-newline a.py
formats it to:I understand why the summary line is being split, because it violates the 88-char summary wrap length. However, I would like
docformatter
to avoid splitting the summary into a description like so:I think what this warrants is:
--no-split-summary-description
or--no-split-first-sentence
\n
The text was updated successfully, but these errors were encountered: