Skip to content

DOC: Add validation error when a docstring is missing #23648

Closed
@datapythonista

Description

@datapythonista

We have the script scripts/validate_docstrings.py that checks several formatting errors in the docstrings.

Currently, when a function, method... has no docstring at all, it fails few of the checks, but we don't have one specific to it. See for example:

$ ./scripts/validate_docstrings.py --prefix=pandas.Series.imag
pandas.Series.imag: Docstring text (summary) should start in the line immediately after the opening quotes (not in the same line, or leaving a blank line in between)
pandas.Series.imag: Closing quotes should be placed in the line after the last text in the docstring (do not close the quotes in the same line as the text, or leave a blank line between the last text and the quotes)
pandas.Series.imag: No summary found (a short summary in a single line should be present at the beginning of the docstring)

What would be useful is to add a new check, that reports that the function does not have a docstring. And in the previous errors, check when the docstring is empty, and do not report them. So the previous call should report a single error with a text like pandas.Series.imag: No docstring found.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions