Skip to content

validate_docstrings.py as a separate package? #28822

Closed
@rth

Description

@rth

The docstring validation script is quite nice! I would like to use it for instance to validate docsting in scikit-learn, e.g.

python pandas/scripts/validate_docstrings.py sklearn.linear_model.LinearRegression

works, but then is a bit more difficult to customize being pandas specific.
In particular it would be nice to have the ability to specify which error to include / exclude in some config file. Also for instance scikit-learn has some default configuration for doctests that is currently ignored in setup.cfg,

[tool:pytest]
doctest_optionflags = NORMALIZE_WHITESPACE ELLIPSIS

Overall, it would be nice if this script was a separate project with a shared core functionality and possibly some config that that projects could personalize a bit if needed (although going with the 'black' approach with one set of rules for all is also a possibility).

Docstring validation is a problem that is relevant for a number of scientific python projects and it would be a shame if each one solves it independently. As far as I can tell, so far this script provides more relevant errors for scientific python projects that say pydocstyle. Using the same tool for validation, would also help making docstrings formatting more consistent across projects.

Also this script is bound to grow in scope (e.g. #28701) and eventually sharing the maintenance with maintainers of other projects might be useful. Although I agree that it might add some overhead with respect to your CI integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions