Skip to content

Enforce remaining docstring↔signature consistency rules (D417, DOC502, DOC201) #1195

Description

@dgarros

Why

Follow-up to #1184, which adopted the Google docstring convention and turned on
the first two consistency rules (DOC102, DOC402). This issue covers the rest of
the docstring↔code accuracy rules — the high-value ones that catch docstrings
that lie about the code. They're currently parked in the ignore list in
pyproject.toml under the "Documentation rules (D and DOC)" block.

Goal: fix the violations and un-park each code so it's CI-enforced going forward.

Non-goals: the "missing docstring" presence rules (D100–D107) — tracked separately
in the Phase 2 issue.

Scope

Three rules remain parked, in ascending order of effort:

Code Rule Count Notes
D417 undocumented-param 22 Mostly client.py; a documented function missing an Args entry
DOC502 docstring-extraneous-exception 31 ⚠️ Known false positives for exceptions raised transitively through helpers — review case-by-case; some may warrant a per-line # noqa rather than a docstring change
DOC201 docstring-missing-returns 194 Largest; splittable per module (client, node, ctl, …)

Total ≈ 247 violations.

Approach

  1. One PR for D417 (22) — smallest, concentrated in client.py.
  2. One PR for DOC502 (31) — triage false positives (transitive raises) vs real
    extraneous Raises: entries; fix the real ones, # noqa: DOC502 the transitive
    ones with a short reason.
  3. DOC201 (194) split across a few PRs by module to keep each reviewable.
  4. Remove each code from the ignore block in pyproject.toml as its count hits zero.

Done when

  • D417, DOC502, DOC201 are removed from the parked ignore list.
  • uv run ruff check is green.
  • uv run invoke docs-generate produces no diff (docstring edits reflected in generated docs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumThis issue should be completed in a less than a daytype/tech-debtItem we know we need to improve way it is implemented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions