PyCQA / pydocstyle

docstring style checker
http://pydocstyle.org
MIT License
1.11k stars 189 forks source link

Codebase itself is not pydocstyle compliant. #464

Closed yanxun827 closed 4 years ago

yanxun827 commented 4 years ago

Out of curiosity, I ran pydocstyle src/ I the pydocstyle codebase and to my surprise there are many errors raised. I would have assumed that a tool being used to check for compliance would strive for compliance itself.

Not sure if this has been raised before or if this is a deliberate decision. If not, I suggest that pydocstring should be part of the CI pipeline, so compliance is maintained for every commit.

Nurdok commented 4 years ago

PEP257 compliance for pydocstyle is checked here. Just running pydocstyle on src/ is not the way to go - we have python files with intentionally invalid code for testing under src/tests/test_cases/.

yanxun827 commented 4 years ago

Thanks for pointing out this is done somewhere as a test.

I tried to replicate what the test does with pydocstyle src/pydocstyle --add-ignore=D104,D105, but I got a few errors. Examples:

src/pydocstyle/parser.py:218 in private class `Docstring`:
    D204: 1 blank line required after class docstring (found 0)
...

Did I miss out on something? Or are these somehow deliberate.

Nurdok commented 4 years ago

@yanxun827 - you're right! I looked again into the test code and there was a bug in the test itself. I fixed both the test and violations in #465.

Thanks for not giving up and keeping us honest!