-
Notifications
You must be signed in to change notification settings - Fork 0
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pydocstyle to static checks #53
base: main
Are you sure you want to change the base?
Conversation
D202, | ||
D203, | ||
D213, | ||
D402, |
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.
Probably also want D401
, which is the imperative mood one. Also, maybe we should put comments after each of these lines with a word or two saying what it is.
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.
The commit message of d2ce6d5 gives my thoughts on D401
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.
And I'd rather just link to http://www.pydocstyle.org/en/3.0.0/error_codes.html ... we don't give description for flake8, which is similarly code-based
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.
It does take a bit of work to cross-reference the two lists, but not many people are going to be editing this, so it's not a big deal to me.
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.
Also, D415 and D416 are missing from that list? They need to update their docs!
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.
Yeah they actually have a problem with their current docs right now as they don't render the table: PyCQA/pydocstyle#380
For D301 (backslashes in docstring), the |
For the |
I also recall there being one place (with nested functions) where Black and pydocstyle were in conflict. EDIT: Oh I see you've ignored D202. That works. |
I ran these checks on nengo bones and nengo core and aside from D401 they pass, did you run it on any other projects? |
Nope, I haven't done it on others. I think those are all the tricky situations I found, and it looks like they're all resolved. As for D401, my vote would be to try making the changes on Nengo and see how hard it is to do in practice, and whether it seems like an improvement. |
Just a note that I marked this as a draft because the intention isn't to review/merge it now as I don't want to block nengo/nengo#1557 I just found this useful in reviewing nengo/nengo#1557 and made this so we can discuss it in the future (probably around the time of the Bones 1.0 work). |
My vote would be to disable D401. I don't think it really helps with readability (we're all used to parsing sentences where the verb doesn't come first, or isn't imperative), and is just a pain in the nonzero number of cases where writing in non-imperative style is a natural way to document something. But I'm fine if someone wants to try it out 🤷♂. |
Motivation and context:
When verifying nengo/nengo#1557, it seemed easier to just enable the checks that were being implemented there than do manual verification that all instances of the issues were fixed. And if we feel like they're worth making a Nengo PR for, we might as well add those checks to Nengo Bones so that we don't add more docstrings that would fail those checks.
That said, this PR likely needs some discussion; see the todo section at the bottom.
How has this been tested?
Applied to Nengo Bones.
How long should this take to review?
Types of changes:
Checklist:
Still to do:
D401
, see the squash commit in this PR)