PyCQA / pydocstyle

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

Should `__main__.py` really be considered a public module? #644

Open CobaltCause opened 1 year ago

CobaltCause commented 1 year ago

Reading this, I wouldn't think so; it seems to imply that nothing should be defined in that file and then imported elsewhere. Yet, pydocstyle will give me such errors as D100: Missing docstring in public module in __main__.py, which I found surprising. I'm not entirely certain which behavior is correct, though.

Looking at git blame for the relevant code, it seems to have not been touched since 2020-09-05, whereas __main__.py was added in Python 3.10 on 2021-10-04, so maybe pydocstyle isn't treating this specially simply because this feature didn't exist at the time the relevant code was written.