Enforce some pydocstyle lints with flake8-docstrings & docstring fixes in testing/#7603
Conversation
tox.ini
Outdated
|
|
||
| [flake8] | ||
| max-line-length = 120 | ||
| select = E,F,W,C,TYP,D200,D201,D206,D207,D208,D210,D211,D212,D214,D215,D300,D301,D403,D404 |
There was a problem hiding this comment.
pydocstyle has an extensive list of error codes. Most of them we don't want, and some have too many false-positives. So I opted to only select the error codes we want instead of excluding those we don't want.
I'm not sure if this is the best way to achieve this -- suggestions welcome.
There was a problem hiding this comment.
in general, extend-ignore is preferred over select
There was a problem hiding this comment.
OK, updated to use extend-ignore.
This comment has been minimized.
This comment has been minimized.
de82ee6 to
3ed7a98
Compare
Does it fix the code for you automatically (like black), or does it just complain about it? |
It just complains. |
|
Gotcha! |
In preparation for enforcing some docstring lints.
There are some ones we *would* like to enforce, like
D401 First line should be in imperative mood
but have too many false positives, so I left them out.
3ed7a98 to
9a18b57
Compare
As discussed in #7471, we now have a preferred docstring style. While I was initially reluctant to add lints for the style we settled on, based on past experience, I tried pydocstyle again and it was quite useful, and I changed my mind. So this PR adds flake8-docstrings to our pre-commit setup.
The previous PR #7510 fixed docstring issues in
src/. Since the lint works on the entire code, this PR also has a commit to fix issues intesting/.