-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
CI: Using docstring validator from numpydoc #30746
CI: Using docstring validator from numpydoc #30746
Conversation
…being validated (it was a warning)
This reverts commit 516fdeb.
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.
Makes sense. For the codes that are left over do you see another home for them, like code checks or any of the other validators? Would be nice to do away with these scripts altogether if mostly covered by third parties
scripts/validate_docstrings.py
Outdated
@@ -1021,7 +400,7 @@ def header(title, width=80, char="#"): | |||
choices=format_opts, | |||
help="format of the output when validating " | |||
"multiple docstrings (ignored when validating one)." | |||
f"It can be {str(format_opts)[1:-1]}", | |||
"It can be {}".format(str(format_opts)[1:-1]), |
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.
I think worth keeping the f-strings
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.
Yep, missed that in a merge, which are quite tricky. Thanks.
The assumption here is that we want to be able to have a script that reports all the errors for a specific docstring. The one we used in the sprints, which we'll be using again when fixing one docstring at a time. Otherwise, we could do what you say. And the validation for pep8 errors in the examples, which is the most tricky one, could just be deleted, since we can use pytest for that. One thing to consider is that the numpydoc script is expected to be wrapped if used in the CI. It can be used directly for a single object, but we need to implement the functionality to get which objects we want to validate, which I think it's more than half of the new script. |
@WillAyd can you remove the requested changes flag if you don't have further comments. Thanks! |
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.
lgtm
Merging this today if there are no further comments. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
We moved our script to numpydoc, and it already had some improvements there. The script does like 80% of our validation, so what I'm doing here is to call numpydoc validation, and then call our custom validation (things that for different reasons weren't moved to numpydoc).