Say that I have
def foo()
"""This is the first part of the summary,
and this is the second part of the summary.
This is the description.
"""
I got both D205 and D400 docstring style warnings triggered.
I want to be able to break the line because I am working with the 80-columns limit and I want to keep it.
Shall I just ignore these warnings?
From pycodestyle documentation:
D205: 1 blank line required between summary line and description
D400: First line should end with a period
So this should be fine:
def foo():
"""This is the first line of the summary.
and this is the second.
This is the description.
"""
Pep-0257 says:
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. The summary line may be used by automatic indexing tools; it is important that it fits on one line and is separated from the rest of the docstring by a blank line.
So you should shrink it down so that it fits in one line. That first line is used by some libraries like click. So multi line summary is not correct at the first place.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With