Adopt Skylos for generated dead-code detection - #43
Conversation
Record the rationale for adding Skylos to the generated Python lint gate. Define a guarded, reason-required allowlist workflow and the documentation, contract-test, and rollout work needed for adoption.
|
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:
WalkthroughChangesSkylos adoption
Poem
🚥 Pre-merge checks | ✅ 19 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (19 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@docs/adr-004-adopt-skylos-for-dead-code-detection.md`:
- Around line 7-9: Update the Date value in ADR-004 to 2026-07-23, unless the
actual approval date is different; preserve the existing date format.
- Around line 58-62: Update the deadcode rejection rationale in the ADR to
include an explicit as-of date and define the maintenance criterion used to
judge its activity as too weak. Retain the existing release information, but
connect it to that dated criterion rather than relying on release age alone.
- Around line 94-105: Update the `make skylos-allow` specification to require
Skylos’ exact `whitelist` interface: invoke `skylos whitelist --reason ...` for
one NAME/pattern and reason, and persist entries under `[tool.skylos.whitelist]`
in `pyproject.toml`. Keep the wrapper’s required-value validation and ensure
contract tests target this exact CLI and configuration surface without report
scraping or baseline generation.
🪄 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: 106a3754-43c1-4b8b-8a8d-ce3f0e2684fc
📒 Files selected for processing (1)
docs/adr-004-adopt-skylos-for-dead-code-detection.md
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
leynos/whitaker(auto-detected)leynos/cuprum(auto-detected)leynos/mdtablefix(auto-detected)
Require the generated wrapper to invoke Skylos' reasoned whitelist command for one name and persist the result in the documented `pyproject.toml` configuration surface. Make the corresponding contract-test expectations explicit.
Summary
This branch records the proposed adoption of Skylos as the generated Python
template's dead-code detector. It closes a quality-gate gap in which plausible
but unused code, particularly residue from large language model-assisted
changes, can pass formatting, linting, typechecking and tests.
The decision keeps the default check local and deterministic, integrates it
with the existing lint interface, and requires narrow, reasoned exceptions. It
also rejects
deadcode, Vulture and review-only detection, while keepingSkylos' cloud, security, remediation and optional model-backed features outwith
the adopted scope.
Review walkthrough
for the problem statement and evaluated alternatives.
make lintandguarded
make skylos-allowinterfaces, including the allowlist discipline.authorized follow-up implementation and its validation boundaries.
Validation
markdownlint-cli2 docs/adr-004-adopt-skylos-for-dead-code-detection.md:passed with no errors.
make spelling: passed.git diff --check: passed.Notes
This draft PR records a proposed architecture decision only. It does not yet
change the generated dependency set, Makefile targets, template guidance or
parent user documentation; those changes remain in the ADR's migration plan.