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
{{ message }}
This repository was archived by the owner on Nov 3, 2023. It is now read-only.
If I have have long lines in a docstring that need to remain so (e.g., a doctest that produces long output), it gets flagged by pycodestyle for exceeding the 79-character line limit (E501). However, if I use backslash-newlines to wrap the doctest, then pydocstyle flags it with D207 and D301. Short of using # noqa, is there some other workaround? If not, can D207/D301 be enhanced to permit backslash-newline wrapping as valid?
example.py:
"""Module docstring."""deffoo():
"""Docstring not liked by pycodestyle. >>> print("this is a doctest which produces some long unwrapped output, sorry about that!") this is a doctest which produces some long unwrapped output, sorry about that! """passdefbar():
"""Docstring not liked by pydocstyle. >>> print("this is a doctest which produces some long unwrapped output,\sorry about that!") this is a doctest which produces some long unwrapped output,\sorry about that! """passif__name__=="__main__":
importdoctestdoctest.testmod()
GLMATTHE-M-33R4:cot glmatthe$ pycodestyle example.py
example.py:7:80: E501 line too long (95 > 79 characters)
example.py:8:80: E501 line too long (82 > 79 characters)
GLMATTHE-M-33R4:cot glmatthe$ pydocstyle example.py
example.py:13 in public function `bar`:
D301: Use r""" if any backslashes in a docstring
example.py:13 in public function `bar`:
D207: Docstring is under-indented