Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Make multiline docstrings start with a newline.#17125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
At least delete D213 ignore from |
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"... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Comments: While we're at it, for the touched docstrings at least, finish them with a period.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
sure, done |
timhoffm commentedApr 13, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That's a separate error code: D200. I think D213 still allows
There wasPyCQA/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 openedPyCQA/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 closePyCQA/pydocstyle#184 and require the authors to instead shorten the docstring. :sad: Though I don't think that's a reasonable way. |
anntzer commentedApr 13, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not sure how it matters here (this is not about requiring a single-line summary) or even if an exegesis of PEP257 makes sense, but if we're going to go that route note that PEP257 contains the example (verbatim)
so "triple-quotes + newline + single-line-docstring + newline + triple-quotes" is apparently allowed. |
This got accidentally ignored inmatplotlib#25147.We want D213 (matplotlib#17125,matplotlib#17193)https://matplotlib.org/devdocs/devel/document.html#quote-positions
This got accidentally ignored inmatplotlib#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