-
Notifications
You must be signed in to change notification settings - Fork 36
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 Doc Linting to CI #294
Conversation
Co-authored-by: Jenny Fothergill
Looks like CI is working how I would expect and fails due to some formatting errors. |
@mikemhenry what sort of input will it take to get this out of draft? What decisions need to be made to move this PR forward? Deciding whether pydocstyle is the right tool? |
@mikemhenry how are things here? If possible, it would be nice to make progress with this PR so that we can have some of our new contributors look into the downstream issues. |
Next steps to get this out of draft:
|
@bdice I've made some changes to the CI, looking at the output it looks good to me, was that what you were thinking? |
@mikemhenry Looks swiggity sweet to me. With that, (1) and (2) are done. Then we just fix that file (3) and it will be ready to merge. After that we can open issues to improve doc style for each submodule ( |
Codecov Report
@@ Coverage Diff @@
## master #294 +/- ##
===========================================
- Coverage 76.18% 65.15% -11.03%
===========================================
Files 43 40 -3
Lines 7076 5700 -1376
===========================================
- Hits 5391 3714 -1677
- Misses 1685 1986 +301
Continue to review full report at Codecov.
|
Can you create a list linking to those placeholders and then we can work through them? |
As per PyCQA/pydocstyle#60, I'm in favor of not requiring docstrings for magic methods. pydocstyle supports suppressing this warning, and I think that makes sense since the behavior of most magic methods should be obvious in the majority of cases.
For |
I'm fine with ignoring magic methods as a default. If during a code review there is a magic method that seems confusing, that would be the time to make sure we get it documented. RE docstring inheritance, I will check to see if pydocestyle supports it. Since right now I only whitelist one file, that might interfere with its abilities. |
I haven't found a tool that will be able to lint docstrings and understand inheriting them from different classes and it is a know issue: PyCQA/pydocstyle#309 |
I had to manually re-run some tests but everything passes now and this PR is ready for review! |
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.
@mikemhenry I pushed one set of minor edits and have one comment. Otherwise approved.
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.
The doc-string for the __str__
method still needs to be removed, and I've made two suggestions for improvement, but otherwise this looks good to me. Thx a lot!
Co-Authored-By: Carl Simon Adorf <[email protected]>
Co-Authored-By: Carl Simon Adorf <[email protected]>
I am going to merge this since it has 2 approvals - I applied a couple of small changes at the end to ignore D105. To ignore D105, I had to disable the "numpy" convention. I reviewed the rules that are ignored by the numpy convention and I removed a couple of those ignore rules (so we're slightly "stricter"). See here for info: http://www.pydocstyle.org/en/latest/error_codes.html#default-conventions |
Sweet, thanks so much for taking those lest steps! |
Add automated doc string checking to CI
Description
We are using
pydocstyle
to check that our document strings are in thenumpy
docstring style. The configuration forpydocstyle
is insetup.cfg
. For now I'm keeping things rather basic, but we might find it worth printing more detailed information once we get everything passing. I also chosesignac/core/jsondict.py
as the first file for testing this, feel free to suggest another file if you think there is a better candidate.Before we fix the issues with this file's document strings, I want to make sure CI will throw an error.
@jennyfothergill is co-authoring this PR.
Motivation and Context
See this issue for more detail:
glotzerlab/signac-docs#64
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist:
If necessary:
Example for a changelog entry:
Add docstring linting to CI
Fix docstring formatting in signac/core/jsondict.py