fix: pre-commit tweaks - #91
Conversation
bryce-lynn-nttd
left a comment
There was a problem hiding this comment.
Clean follow-up to PR #88's normalization. Directly addresses my prior non-blocking note about uv-sync/uv-lock running unconditionally on every commit — now scoped with files: ^pyproject\.toml|^uv\.lock$ filters.
Verifications:
- Both
uv-lockanduv-sync(pre-commit stage) gated on actual config changes via thefiles:filter. uv-synccorrectly split into two hook entries: pre-commit stage with the file filter, and post-checkout/post-merge/post-rewrite stages without filter (those are user-initiated events with no "files changed" semantic, so unconditional run is right).- Version bumps aligned:
uv 0.8.16 → 0.11.17in.tool-versionsmatchesuv-pre-commit 0.9.7 → 0.11.17in.pre-commit-config.yaml. - CI's Pre-Commit Checks passing on this PR confirms the
pre-commit-hooks v4.5.0 → v6.0.0(skipping v5) lands clean for the hooks actually configured here. - Title-driven
fix:→fixlabel applied correctly under the new scheme PR #88 introduces.
Non-blocking:
pre-commit-hooks v4.5.0 → v6.0.0skips a major version. v5.x.x had a few hook signature changes (mostly around argument defaults). For the hooks actually used here, CI confirms it's clean — purely informational.
Generated with Claude Code (Opus 4.7)
ben-vaughan-nttd
left a comment
There was a problem hiding this comment.
Codex PR Review
Note: This pull request review was generated by Codex.
Review Decision
REQUEST_CHANGES
High Findings
- (none)
Medium Findings
- Severity: medium
Location:.pre-commit-config.yaml:40
Issue: The pre-commit-stageuv-synchook still runs for unrelated file changes despite the newfiles:filter.
Impact: The PR description says this change keepsuv-syncfrom running on commit unless relevant files changed, butuv-syncfromuv-pre-commitdeclaresalways_run: truein its hook manifest. Because this override does not setalways_run: false, a README-only pre-commit run still executeduv-sync, preserving the unnecessary commit-time sync behavior this PR is meant to remove.
Recommendation: Addalways_run: falseto the pre-commit-stageuv-syncoverride, and consider anchoring the file regex as^(pyproject\.toml|uv\.lock)$for clarity. Keep the post-checkout/post-merge/post-rewriteuv-synchook unconditional.
Low Findings
- (none)
Nitpicks
- (none)
Previously Raised Findings Confirmed
- The prior reviewer’s informational note about
pre-commit-hooksjumping fromv4.5.0tov6.0.0still applies. Codex is not claiming this as a new finding.
Open Questions / Assumptions
- (none)
Required Workflow Status
- Required workflows overall:
pass - Failing required workflows: none
- Pending required workflows: none
Validation Notes
- Local checkout used:
yes - Existing PR comments/reviews checked:
yes - Existing findings confirmed but not claimed as new: prior major-version-jump note remains informational
- Net-new blocking findings from Codex: pre-commit-stage
uv-syncstill runs for unrelated files - Unresolved blocking findings from other reviewers: none observed
- Required workflow checks evaluated:
yes - Required workflow failures found: none
- Required workflow failure investigation performed: not needed
- Instruction files discovered: none found
- Instruction files applied: workspace-level review guidance
- Instruction files skipped as out-of-scope: none
- User clarification requested for ambiguous scope: no
- Older duplicate Codex blocking review dismissed: no
- Checks/tests executed:
pre-commit validate-config;pre-commit run --all-files;pre-commit run uv-lock --files pyproject.toml;pre-commit run uv-sync --hook-stage pre-commit --files pyproject.toml;pre-commit run uv-lock --files README.md;pre-commit run uv-sync --hook-stage pre-commit --files README.md;pre-commit run --files README.md;git diff --check
|
Good catch. Was able to validate this by making and then rolling back a local commit and confirming that |
ben-vaughan-nttd
left a comment
There was a problem hiding this comment.
Codex PR Review
Note: This pull request review was generated by Codex.
Review Decision
APPROVE
High Findings
- (none)
Medium Findings
- (none)
Low Findings
- (none)
Nitpicks
- (none)
Previously Raised Findings Confirmed
- Codex’s prior
uv-syncfinding is resolved in the current revision. The pre-commit-stageuv-syncoverride now setsalways_run: false, and README-only validation skips bothuv-lockanduv-sync. - The prior reviewer’s informational note about
pre-commit-hooksjumping fromv4.5.0tov6.0.0still applies. Codex is not claiming this as a new finding.
Open Questions / Assumptions
- (none)
Required Workflow Status
- Required workflows overall:
pass - Failing required workflows: none
- Pending required workflows: none
Validation Notes
- Local checkout used:
yes - Existing PR comments/reviews checked:
yes - Existing findings confirmed but not claimed as new: prior
uv-syncblocker verified resolved; prior major-version-jump note remains informational - Net-new blocking findings from Codex: none
- Unresolved blocking findings from other reviewers: none observed
- Required workflow checks evaluated:
yes - Required workflow failures found: none
- Required workflow failure investigation performed: not needed
- Instruction files discovered: none found
- Instruction files applied: workspace-level review guidance
- Instruction files skipped as out-of-scope: none
- User clarification requested for ambiguous scope: no
- Older duplicate Codex blocking review dismissed: no
- Checks/tests executed:
pre-commit validate-config;pre-commit run --all-files;pre-commit run --files README.md;pre-commit run uv-sync --hook-stage pre-commit --files README.md -v;pre-commit run uv-lock --files pyproject.toml;pre-commit run uv-sync --hook-stage pre-commit --files pyproject.toml;git diff --check
bryce-lynn-nttd
left a comment
There was a problem hiding this comment.
This supersedes my earlier approval (dismissed on the new commit), which was wrong: I claimed the files: filter alone gated the pre-commit-stage uv-sync, but uv-sync ships always_run: true in its manifest, so the filter was inert. Codex's CHANGES_REQUESTED was a legitimate catch. HEAD (de503aa) resolves it.
Verifications at HEAD:
- Pre-commit-stage
uv-syncnow setsalways_run: falsealongsidefiles: ^pyproject\.toml|^uv\.lock$— both are required; the filter does nothing without disablingalways_run. - Post-checkout/post-merge/post-rewrite
uv-syncstays unconditional, which is correct (user-initiated events, no "files changed" semantic). uv-lock(pre-commit) uses only thefiles:filter and skips correctly — confirmed empirically by Chris's manual commit test and Codex's README-only runs (bothuv-lockanduv-syncSkipped).- Version alignment:
.tool-versionsuv 0.8.16 → 0.11.17matchesuv-pre-commit rev 0.11.17. - CI green at HEAD: Pre-Commit Checks, Validate PR Title, Label PR all SUCCESS.
Non-blocking (optional):
- Regex
^pyproject\.toml|^uv\.lock$parses as^pyproject\.tomlOR^uv\.lock$; the first alternative isn't end-anchored.^(pyproject\.toml|uv\.lock)$is clearer. Harmless in practice. pre-commit-hooks v4.5.0 → v6.0.0skips v5; CI confirms the configured hooks land clean. Informational.
Generated with Claude Code (Opus 4.8)
Other minor fixes from #88 not covered in #89 and #90:
uvversion to latest in .tool-versionsuvpre-commit actions to keep sync from running on commit unless one of the relevant files has changed.