Skip to content

DOC: Validate space before colon in the parameters section of the docstrings #23483

Closed
@datapythonista

Description

@datapythonista

In the docstrings, parameters are documented like this:

Parameters
----------
name : str
    The name of the person.

It is common that the space before the colon is not present, and in that case validate_docstrings.py reports:

  • Parameter "name: str" has no type

Which is confusing, and new contributors may have problems understanding what the problem is. We should validate this specific problem, and report an appropriate error message like A space is required before the colon separating the parameter name and type.

This needs to be tested (in scripts/tests/test_validate_docstrings.py).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions