Skip to content

[FEA] Lint all Python docstrings using ruff's pydocstyle rules #10711

Open
@vyasr

Description

@vyasr

Is your feature request related to a problem? Please describe.
Our Python docstrings have various style violations when compared against standards like pep257. Not only does this impact readability (which may be subjective), it also reduces the effectiveness of tools like Sphinx or numpydoc that rely on specific formatting in order to parse docstrings.

Describe the solution you'd like
We should lint all of our docstrings using pydocstyle, the standard for docstring linting in the Python ecosystem. I added support for pydocstyle in #7985 and have since added support for a few additional modules, but many of our most prominent public-facing APIs are not yet linted. My reticence to lint those files has stemmed in large part from the degree to which these files have been refactored recently and the number of docstrings that were rendered obsolete in the process. However, that process is largely complete now, at least for the most important public APIs, so I think we are at a good stage to start working through the remaining changes systematically.

While we have added pydocstyle on a per-file basis up to now, not all of pydocstyle's rules make sense for us since matching pandas is a higher priority. As a result, going forward we will enable rules on a per-rule rather than per-file basis so that we can get the most value out of pydocstyle without conflicting with preexisting pandas conventions. For more extensive discussion of different rules and why we choose to enable some or not, see the excellent table compiled by @bdice a few comments below..

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - BacklogIn queue waiting for assignmentPythonAffects Python cuDF API.docDocumentationfeature requestNew feature or requestgood first issueGood for newcomersimprovementImprovement / enhancement to an existing function

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions