Skip to content

docs: enforce public docstring coverage via ruff D1 and backfill#22

Merged
jeqcho merged 1 commit into
mainfrom
docs/public-docstring-gate
Jul 14, 2026
Merged

docs: enforce public docstring coverage via ruff D1 and backfill#22
jeqcho merged 1 commit into
mainfrom
docs/public-docstring-gate

Conversation

@jeqcho

@jeqcho jeqcho commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What

Adds Ruff's pydocstyle presence rules (D1) to the lint gate so every public module, class, and function must carry a docstring, and backfills the 32 that were missing. Public docstring coverage (interrogate at the merge-base, excluding private/nested/init): 56.4% -> 97.4%; the residual gap is only the deliberately exempted magic methods (D105) and __init__ (D107, covered by class docstrings). Tests are exempt via per-file-ignores.

Docstrings follow the repo's existing voice: they state the contract or role ("Draw by index so mixed-category scalar types are preserved.") rather than restating the symbol name.

The requirement is documented for contributors in CLAUDE.md's gates bullet and the README Development section.

Why

With external PRs picking up, the gate makes new public API arrive documented, the same way the 100% test-coverage gate makes it arrive tested. Ruff reports the exact undocumented symbol at its line, so contributors get actionable feedback with no new tooling.

Verification

All gates green locally: ruff check, ruff format, strict mypy, pytest at 100% coverage (317 passed), and mkdocs build --strict (docstrings feed no API pages here yet, but the build stays clean).

Implemented by Codex (GPT), reviewed by Fable.

🤖 Generated with Claude Code

Enable Ruff's public pydocstyle rules and exempt tests plus constructor and magic-method boilerplate. Backfill package contracts and document the gate so new public APIs cannot regress.

Interrogate public docstring coverage: 49.3% before, 97.4% after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jeqcho
jeqcho merged commit a605d58 into main Jul 14, 2026
12 checks passed
@jeqcho
jeqcho deleted the docs/public-docstring-gate branch July 14, 2026 01:04
jeqcho added a commit that referenced this pull request Jul 14, 2026
Follow-up to #22, which added the ruff D1 public-docstring gate.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant