Make multiline docstrings start with a newline. - #17125
Conversation
|
Removing it doesn't enforce the check (I tried), and in any case it's not actually fully fixed yet because there's still a problem with single-line docstrings which don't fit in one line when the quotes are in the same line, but do if the quotes are not there. This was raised at least once on the pydocstyle tracker (should be easy to find) and last time I check their response was basically "don't write single-line docstrings of just the line that's annoying"... |
timhoffm
left a comment
There was a problem hiding this comment.
Comments: While we're at it, for the touched docstrings at least, finish them with a period.
|
sure, done |
That's a separate error code: D200. I think D213 still allows
There was PyCQA/pydocstyle#184 with D205 and D400 errors if you have very long first sentences that need to be wrapped. - IMHO they would be relatively easy to fix, but the issue was closed. Additionally, I opened PyCQA/pydocstyle#453, because D200 cannot be fulfilled for docstrings with For now, this means that we cannot check D200, 205, D400, because I don't think we want to or even reasonably can rewrite the first sentence to be descrpitive and fit in 69 chars (or 65 for methods) in all cases. |
A few are still missing. Also inherited a couple more docstrings.
|
ok, removed D213 from .flake8, we'll see how this goes... |
|
Just checked PEP-257 again on multi-line docstrings:
So, if one plays strictly by the rules, it's viable to close PyCQA/pydocstyle#184 and require the authors to instead shorten the docstring. :sad: Though I don't think that's a reasonable way. |
This got accidentally ignored in matplotlib#25147. We want D213 (matplotlib#17125, matplotlib#17193) https://matplotlib.org/devdocs/devel/document.html#quote-positions
This got accidentally ignored in matplotlib#25147. We want D213 (matplotlib#17125, matplotlib#17193) https://matplotlib.org/devdocs/devel/document.html#quote-positions

A few are still missing.
Also inherited a couple more docstrings.
Now we just need to figure out how to flake8-enforce that...
PR Summary
PR Checklist