Skip to content

chore: gate docstring coverage at 100% with interrogate - #93

Merged
tschm merged 1 commit into
mainfrom
chore/interrogate-config
Oct 8, 2026
Merged

tschm merged 1 commit into
mainfrom
chore/interrogate-config

Conversation

@tschm

@tschm tschm commented Oct 8, 2026

Copy link
Copy Markdown
Member

Adds docstring coverage as a gate, at 100%.

[tool.interrogate] in collector/pyproject.toml

  • fail-under = 100
  • Exempt: __init__ (the class docstring covers it), dunder methods, and nested functions (the per-repo closures handed to a thread pool, which their enclosing function documents).

The hook. .pre-commit-config.yaml used to leave interrogate out until this table existed. It now runs interrogate 1.7.0 with --config collector/pyproject.toml over the whole package (pass_filenames: false, because fail-under is a share of everything, not of the files a commit touches). The hooks workflow runs it in CI. I updated that config's header comment to match.

The docstrings. Coverage under these exemptions was 76.2%, and this adds the 47 docstrings that were missing. The largest share was the small _add_* exposition helpers in metrics.py (16), then the GitHub/GitLab clients, Store, and the RemoteSource Protocol stubs. Each one was written after reading the function, and none changes code.

Verified

  • prek run --all-files: all hooks pass, including the new interrogate (100.0%).
  • I deleted one docstring locally and the hook failed at 99.5%, so the gate isn't vacuous. Then I restored the docstring.
  • mypy (strict) is clean, including the Protocol methods whose bodies are now docstrings rather than ....
  • pytest: 477 passed, 100% of lines and branches.

🤖 Generated with Claude Code

Adds [tool.interrogate] to collector/pyproject.toml (fail-under = 100,
exempting __init__, dunders and nested functions) and the interrogate hook,
pointed at that table, to .pre-commit-config.yaml so CI enforces it. Writes
the 47 docstrings the package was missing to get there from 76.2%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tschm
tschm merged commit a890389 into main Oct 8, 2026
7 checks passed
@tschm
tschm deleted the chore/interrogate-config branch October 8, 2026 14:02
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