Skip to content

TST/ENH: add default values check to validate_docstrings.py #28701

@josibake

Description

@josibake

Problem description

Per contributing_docstring#section-3-parameters, default values should be documented as such:

  • int, default 0
  • int, default -1, meaning all cpus (optional descriptions)

Currently, the validate_docstrings.py script does not check default values. This should be added to ensure valid docstrings.

Proposal

Add a new validation, "PR11", to the validate_docstrings scripts. "PR03" compares the ordering of the actual arguments to the documented arguments: this might be a good starting point. The validation would need to

  • check which params have a default value
  • check that the documentation for the parameter has the correct format for default value documentation
  • check that the documented value matches the actual value

Questions

  • If default values documentation is enforced, does it make sense to allow optional descriptions inline?
  • Can it be verified that the parameter description includes the default value description?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions