Hi, Is there any plan to add <pydocstyle> as a lin...
# general
r
Hi, Is there any plan to add pydocstyle as a linter? I was thinking of contributing.
w
Question: How is this different than
docformatter
? I've never used pydocstyle
r
docformatter currently automatically formats docstrings to follow a subset of the PEP 257 conventions. Below are the relevant items quoted from PEP 257.
As far as I understand it will just format the existing docstring but not complain about missing ones
w
Oh, I thought it did... Oh, hmm, maybe I'm thinking of pylint or one of the other linters
r
I also thought initially that docformatter was enough. But then saw people adding no docstring and realized that we need some other linting tool to catch missing docstring
For now I have added pydocstyle to our pre-commit-config outside of pants. So it works.
b
r
So you added it as a flake8 plugin ? @bitter-ability-32190
b
Yes, add that library and also if you want to, pin the version of
pydocstyle
w
Also, doesn't this come with pylint? I remember being annoyed by missing doc complaints by one of the tools on some sample code I wrote. Thought it was pylint https://pylint.pycqa.org/en/latest/user_guide/messages/convention/missing-module-docstring.html
r
By the way where do you add the config for the plugin. So for flake8-pydocstyle, I should add it in my flake8 config, right? For pydocstyle, that would be
Copy code
[pydocstyle]
inherit=false
add_ignore=D100,D105,D107,D203,D401,D405,D415
match=^((?!(test|__init__)).)*$
ignore_decorators=app.exception_handler
b
Yes to adding it to flake8 config. I think the plugin copies all the config entries though. You'll have to play around with it
h
That said, we'd have no objection that I can think of to adding it as a standalone linter!
b
+1 we welcome contributions to core, and this sounds like an addition that other folks would appreciate having.