-
Notifications
You must be signed in to change notification settings - Fork 23
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 pydoc with ruff check that public classes should have documentation. #1034
Conversation
Didn't know ruff supported that Can you check if it respects inheritance (docstring in parent but not in child)? That was one of the reasons we made the separate tool - at the time as I recall other linters required the docstrings regardless |
Also does it apply to public methods? |
It does not. Check the hdmf changes in this PR. But I think that's a good thing. The corresponding # noqa: (e.g. # noqa: D101) should be added in those cases. I think this works as a check that the developer knows what they are doing and that the docstring does not require changes specific to the context of the function/class (as per the discussion on the meeting today about docstring consistency) |
@CodyCBakerPhD Which is nice because we can move forward piece-wise. |
And this would be an alternative to #1028 right? |
Right. |
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.
Looks good to me!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1034 +/- ##
=======================================
Coverage 90.42% 90.42%
=======================================
Files 129 129
Lines 7924 7924
=======================================
Hits 7165 7165
Misses 759 759
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Closes #1028 (as an alternative).
For discussion:
@pauladkisson @CodyCBakerPhD
My arguments for:
I personally like how fast ruff is is to check this and we can activate rules one by one. For example, we can exclude the rule D100 (forcing modules to have docstrings) that @bendichter disliked or anything else from this list:
https://docs.astral.sh/ruff/rules/#pydocstyle-d