DOC: Validate the Returns section in the docstrings
See original GitHub issuescripts/validate_docstrings.py
validates that the content of a docstring follows our standards. There are still some of those standards that the script does not validate, and this gives the users the wrong impression that the docstring is all right, when it’s not really the case. All the missing validations are listed in #20298.
The format of the Returns
section consists of a first line with just the type, and afterwards indented the description. In the case a tuple is returned, then the format is name : type or types
for each parameter, and indented descriptions after them. The descriptions need to start with a capital letter and finish with a period. See: https://pandas.pydata.org/pandas-docs/stable/contributing_docstring.html#section-4-returns-or-yields
For this issue is required:
- Change
scripts/validate_docstings.py
to give errors if some of the described formats are not satisfied. - Add tests in
scripts/tests/test_validate_docstrings.py
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
In this case it should fail because there is a single value being returned, and it contains the name
obj_head
.The correct cases are:
I’ve added some checks in
validate_docstrings.py
, and some corresponding tests.i’ve created the following pull request : #23432
(sorry, i’m not very familiar with github, i hope I’ve done this the right way…)