Enforce docstring coverage in lint gates#15
Conversation
Add `interrogate` to rendered project dev dependencies and wire it into both rendered and parent `make lint` targets so docstring coverage is gated.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis pull request integrates the ChangesInterrogate Docstring Coverage Enforcement
Possibly Related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (18 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
`cargo audit` in the generated CI workflow fails on pyo3 0.28.3, which is affected by RUSTSEC-2026-0176 (out-of-bounds read in `nth` / `nth_back` for `PyList` and `PyTuple` iterators). This caused the `Audit dependencies` step to fail in the act validation test before the coverage step could run. The advisory's fix is pyo3 >= 0.29.0. The rendered extension crate compiles unchanged against 0.29.0 (the `Bound` module API is stable across the bump), and `cargo audit` on the rendered lockfile is clean.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/helpers/pyproject_contracts.py`:
- Around line 35-43: Add "pytest-timeout" to the required dev-dependency list
used in the for loop in tests/helpers/pyproject_contracts.py (the list iterated
by the variable dependency) so the contract asserts it exists; update the list
to include "pytest-timeout" alongside "pytest", "pytest-xdist", etc., ensuring
the contract fails if that dependency is missing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 403df03f-9968-49aa-9a19-ef1590422fb8
📒 Files selected for processing (11)
Makefiletemplate/AGENTS.md.jinjatemplate/Makefile.jinjatemplate/pyproject.toml.jinjatemplate/{% if use_rust %}rust_extension{% endif %}/Cargo.toml.jinjatests/helpers/agents_contracts.pytests/helpers/makefile_contracts.pytests/helpers/pyproject_contracts.pytests/test_github_actions_integration.pytests/test_helpers.pytests/utilities.py
Require `pytest-timeout` in the rendered pyproject contract so the existing template dependency cannot be dropped without a failing test.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@template/Makefile.jinja`:
- Line 139: The interrogate command on line 139 of the lint-python target uses
{{ package_name }} as its target, which excludes tests from docstring coverage
measurement. This is inconsistent with the ruff check and pylint commands on the
same target, which both use $(PYTHON_TARGETS). Replace {{ package_name }} with
$(PYTHON_TARGETS) in the interrogate command to ensure consistent coverage
metrics across all linters and include test code in the docstring coverage
measurement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ac278312-1511-41ef-aa60-a34b388ae17f
📒 Files selected for processing (11)
Makefiletemplate/AGENTS.md.jinjatemplate/Makefile.jinjatemplate/pyproject.toml.jinjatemplate/{% if use_rust %}rust_extension{% endif %}/Cargo.toml.jinjatests/helpers/agents_contracts.pytests/helpers/makefile_contracts.pytests/helpers/pyproject_contracts.pytests/test_github_actions_integration.pytests/test_helpers.pytests/utilities.py
Update parent and generated project documentation for the Interrogate coverage check, and add a rendered-project behavioural test proving `make lint` passes with complete docstrings and fails when Interrogate finds missing private docstring coverage.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Run generated Interrogate linting against `$(PYTHON_TARGETS)` so its coverage scope matches the Python lint target set. Update the generated AGENTS guidance, user and developer docs, command contracts, and the behavioural coverage expectation for the wider target set.
|
@coderabbitai pause |
✅ Action performedReviews paused. |
Align the generated AGENTS contract with the rendered Python target list and document the generated `lint-python` Interrogate scope in the parent and template developer guides.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_interrogate_lint.py`:
- Around line 79-80: The assertion on line 79-80 hard-codes a specific coverage
percentage value of 83.3%, making the test brittle when baseline docstring
counts change. Instead of checking for the exact string "actual: 83.3%" in the
output, parse the percentage value from the output and assert that it is less
than 100.0 to verify that docstring coverage has been reduced while remaining
resilient to changes in the baseline counts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d418f781-7ba9-41b2-b9e5-298470ddad66
📒 Files selected for processing (7)
docs/developers-guide.mdtemplate/AGENTS.md.jinjatemplate/Makefile.jinjatemplate/docs/developers-guide.mdtemplate/docs/users-guide.md.jinjatests/helpers/agents_contracts.pytests/test_interrogate_lint.py
|
@coderabbitai pause |
✅ Action performedReviews paused. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "=== template/Makefile.jinja: interrogate line ==="
grep -n "interrogate\|PYTHON_TARGETS\|package_name" template/Makefile.jinja | grep -i "interrogate"
echo ""
echo "=== tests/helpers/agents_contracts.py: interrogate references ==="
grep -n "interrogate\|python_targets\|package_name" tests/helpers/agents_contracts.py
echo ""
echo "=== template/docs/users-guide.md.jinja: interrogate references ==="
grep -n "interrogate\|PYTHON_TARGETS\|package_name" template/docs/users-guide.md.jinja
echo ""
echo "=== docs/developers-guide.md: interrogate and lint-python references ==="
grep -n "interrogate\|lint-python\|Ruff\|Pylint" docs/developers-guide.md
echo ""
echo "=== tests/helpers/makefile_contracts.py: interrogate references ==="
grep -n "interrogate\|PYTHON_TARGETS" tests/helpers/makefile_contracts.py
echo ""
echo "=== template/AGENTS.md.jinja: interrogate references ==="
grep -n "interrogate\|PYTHON_TARGETS\|package_name" template/AGENTS.md.jinjaLength of output: 2818
No further work is required. The scope of |
Parse the Interrogate actual coverage percentage and assert it drops below 100% instead of pinning the behavioural test to a specific rendered-project baseline count.
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Update the template quality gate decision record so the Python lint tier mentions Interrogate with `--fail-under 100` alongside Ruff and Pylint.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@template/AGENTS.md.jinja`:
- Line 85: On line 85 in the template file, replace the literal expansion `{{
package_name }} tests` with the variable reference `$(PYTHON_TARGETS)` to
maintain consistency with the established pattern used on lines 82, 84, and 87
throughout the file, which all reference variables rather than expansions.
In `@tests/helpers/agents_contracts.py`:
- Line 101: In the AGENTS.md contract definition, replace the f-string with
expanded variable `f"interrogate --fail-under 100 {python_targets}"` with a
plain string using makefile-style variable reference `"interrogate --fail-under
100 $(PYTHON_TARGETS)"` to maintain consistency with the ruff check contract
pattern that documents commands using variable references instead of Python
variable expansions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1be7eacc-604c-430b-890a-0f69f8a3b36e
📒 Files selected for processing (7)
docs/developers-guide.mdtemplate/AGENTS.md.jinjatemplate/Makefile.jinjatemplate/docs/developers-guide.mdtemplate/docs/users-guide.md.jinjatests/helpers/agents_contracts.pytests/test_interrogate_lint.py
|
@coderabbitai resume |
✅ Action performedReviews resumed. |
Keep generated AGENTS guidance consistent with the surrounding Makefile command examples by documenting the Interrogate target as `$(PYTHON_TARGETS)`, and update the AGENTS contract to assert that form.
Expand the Interrogate behavioural test module docstring and include the Interrogate docstring gate in the README tooling list and generated quality gate diagram.
|
@coderabbitai Have the following failed checks now been resolved? If further work is required, please provide an AI agent prompt for the remaining work to be done to address these failures. Do not treat warnings as optional or aspirational. Where a change is out of scope for this PR, propose a GitHub issue unless one exists already. (Treat documentation and validation coverage as in scope). ❌ Failed checks (1 error, 1 warning)
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
echo "=== tests/test_interrogate_lint.py: module docstring ==="
head -20 tests/test_interrogate_lint.py
echo ""
echo "=== README.md: lines 10-65 ==="
sed -n '10,65p' README.md
echo ""
echo "=== README.md: full interrogate references ==="
grep -n "interrogate\|Interrogate" README.mdLength of output: 3611
No further work is required on this PR. |
Summary
This branch adds
interrogateto the generated template's development dependency set and wires docstring coverage into both generated and parent lint gates. The change makes missing docstrings fail duringmake lint, so rendered projects and the template repository enforce the same documentation standard.There is no linked issue, roadmap task, or execplan for this branch.
Review walkthrough
interrogateadded to generated dev dependencies.Validation
make test: passed, 32 passed and 2 skipped.make check-fmt: passed, 18 files already formatted.make lint: passed, includinginterrogateat 100.0% coverage.make typecheck: passed.Notes
The rendered lint command targets the generated package name instead of a fixed package path, so projects using a package name other than
ladingreceive the same docstring gate without a broken path.