Skip to content
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

Merged
merged 17 commits into from
Jan 16, 2020
Merged

CI: Using docstring validator from numpydoc #30746

merged 17 commits into from
Jan 16, 2020

Conversation

datapythonista
Copy link
Member

@datapythonista datapythonista commented Jan 6, 2020

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).

@datapythonista datapythonista added Docs CI Continuous Integration labels Jan 6, 2020
@datapythonista datapythonista changed the title WIP: Using docstring validator from numpydoc CI: Using docstring validator from numpydoc Jan 7, 2020
Copy link
Member

@WillAyd WillAyd left a 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

@@ -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]),
Copy link
Member

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

Copy link
Member Author

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.

@datapythonista
Copy link
Member Author

For the codes that are left over do you see another home for them, like code checks or any of the other validators?

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.

@datapythonista
Copy link
Member Author

@WillAyd can you remove the requested changes flag if you don't have further comments. Thanks!

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@datapythonista
Copy link
Member Author

Merging this today if there are no further comments.

@datapythonista datapythonista merged commit 2170f4e into pandas-dev:master Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants