Skip to content

DOC: scripts/validate_docstrings.py should detect when the short summary span over multiple lines #22615

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

Closed
Moisan opened this issue Sep 5, 2018 · 4 comments · Fixed by #22617
Labels
Docs good first issue Testing pandas testing functions or related to the test suite
Milestone

Comments

@Moisan
Copy link
Contributor

Moisan commented Sep 5, 2018

Code Sample, a copy-pastable example if possible

Take any docstring and write a short summary (the first line of the docstring) on multiple lines. Then test it with ./scripts/validate_docstrings.py pandas.DataFrame.my_method.

Problem description

As discussed in #22516 and in the documentation, the first line of the docstring should be a short summary and shouldn't take more than one line.

Expected Output

An error stating that the first line (the short summary) should not be more than one line long.

@WillAyd
Copy link
Member

WillAyd commented Sep 5, 2018

Hmm I think we have this generally covered and tested:

('BadSummaries', 'multi_line',

Isn't the first line in the linked PR a single line anyway? @datapythonista

@WillAyd WillAyd added Testing pandas testing functions or related to the test suite Docs labels Sep 5, 2018
@datapythonista
Copy link
Member

Seems like before fixing the docstring to have a short summary, the script had the reported problem, as @Moisan showned here: https://gist.github.com/Moisan/5b349fddeea6f7ed83987673f7bde5de

@WillAyd
Copy link
Member

WillAyd commented Sep 5, 2018

Ah OK - I thought this was referring to the current state of the PR, which is now correct. That makes more sense :-)

@datapythonista
Copy link
Member

@Moisan feel free to send a PR, you can use the beginning of your original docstring for the test that reproduces the error. I guess it has to do with the latex code, as in most cases the script works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs good first issue Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants