feat(scaffold): per-repo pre-commit tools registry (L2 additive merge) - #2663
Conversation
Site previewPreview: https://2007b98a-site.fullsend-ai.workers.dev Commit: |
PR Summary by Qodofeat(scaffold): per-repo pre-commit tools registry with L2 additive merge Description
Diagram
High-Level Assessment
Files changed (9)
|
|
🤖 Review · |
Code Review by Qodo
1. ADR 0035 not linked
|
b6bfa7f to
c31a442
Compare
|
🤖 Review · |
Documents the L2 additive merge design: per-repo .pre-commit-tools.yaml at repo root extends upstream/org defaults. Covers three-layer resolution order, merge semantics (extend/override/exclude), and base-branch-only reads for supply-chain security. Relates: #1270 Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
…erge Refactor resolve() to accept a parsed dict instead of a file path. Add merge_registries() that merges a per-repo .pre-commit-tools.yaml with upstream/org defaults: new entries extend, matching (repo, hook_id) entries override, and exclude: true suppresses. Add --local-registry CLI arg. Caller scripts extract the base-branch registry via git show (not the PR head) for supply-chain safety and pass it to the resolver. Also fixes #1270 P1: add uv match_entry so hooks with entry "uv run ..." are recognized alongside the existing "uvx" match. Closes: #1270 Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
c31a442 to
9a6981c
Compare
Add "Customizing Pre-commit Tool Dependencies" section to the customizing-agents guide. Covers three-layer resolution, examples for adding and suppressing entries, and the base-branch security model. Add unit tests for merge_registries() and resolve() covering extend, override, exclude, dedup, uv/uvx match, malformed input, and end-to-end merged resolution. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
9a6981c to
34c0aca
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Review · ✅ Success · Started 3:24 PM UTC · Completed 3:38 PM UTC |
ReviewFindingsMedium
Previous runReviewFindingsMedium
Labels: PR adds a new per-repo additive merge feature to scaffold harness scripts with accompanying ADR and user documentation. Previous run (2)ReviewFindingsMedium
|
- Warn on match_entry collisions during L2 additive merge to prevent silent shadowing of upstream entries - Move test file to scripts/ directory alongside implementation, rename to match project convention (resolve-precommit-tools-test.py) - Add ADR 0035 cross-reference link in ADR 0056 - Condense ADR consequences to one-sentence bullets - Add Prerequisites section and numbered steps in user guide Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 4:22 PM UTC · Completed 4:33 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 7:52 PM UTC · Completed 8:00 PM UTC |
Retro: PR #2663 — Per-repo pre-commit tools registry (L2 additive merge)TimelineHuman-authored feature PR by waynesun09, opened and merged same day (2026-06-25). The review agent ran 3 successful reviews across 3 commits, catching 4 medium-severity findings. The author fixed 3 of 4 (edge-case in What went well
Known issues observed (skipped as proposals)
One proposal belowThe agent-human review delta on this PR was stark: the agent caught issues across 4 dimensions (correctness, conventions, documentation, scope), while the human contributed zero findings. The structural gap is that persisting agent findings are easy to overlook when approving. Proposals filed
|
Summary
Extends the pre-commit tools registry (#1055) with per-repo additive merge:
.pre-commit-tools.yamlat repo root to extend the upstream/org registry. New entries append, matching(repo, hook_id)entries override,exclude: truesuppresses.git show origin/${TARGET_BRANCH}:...), not the PR head. Changes take effect only after merge.uvmatch entry so hooks withentry: "uv run ..."are recognized alongsideuvx.shellcheck-pyis auto-managed by pre-commit (no registry entry needed).Three-layer resolution
Changes
docs/ADRs/0056-per-repo-precommit-tools-registry.mdresolve-precommit-tools.pyresolve()to accept dict, addmerge_registries(), add--local-registryCLI arg.pre-commit-tools.yamluvmatch entry (P1), shellcheck-py note (P2), update header docspost-code.sh,post-fix.sh,pre-code.sh,pre-fix.sh--local-registrycustomizing-agents.mdtest_resolve_precommit_tools.pyTest plan
python3 internal/scaffold/scripts-tests/test_resolve_precommit_tools.py— 13/13 passgo test ./internal/scaffold/...— existing Go tests passmake lint— passesentry: "uv run mypy"matches theuvregistry entryexclude: trueon gitleaks suppresses the upstream entryCloses #1270