refactor(git-hooks): move validators to ci/ and reduce hooks to adapters - #223
Merged
Conversation
Replace the two legacy ci/ validation scripts (conventional_commits.sh, validate_conventional_commit.sh) with direct calls to their counterparts under git-hooks/: git-hooks/validate-commit-range and git-hooks/validate-conventional-subject. - Delete ci/conventional_commits.sh and ci/validate_conventional_commit.sh - Update .github/workflows/ci.yaml to run ./git-hooks/validate-commit-range - Update app/usage-rules.md to reference git-hooks/validate-commit-range The hook installer (mix git_hooks), the hook wrappers (git-hooks/commit-msg and git-hooks/pre-push), the shared validators, and documentation were already updated by EXT-29 (db08f0e / 044459e). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ci/validate_conventional_subject.sh, ci/validate_pull_request_title.sh, ci/validate_commit_range.sh, and ci/validate_push_refs.sh are now the canonical check programs. git-hooks/commit-msg and git-hooks/pre-push are thin exec wrappers that delegate to them. mix precommit and GitHub Actions call ci/ scripts directly. Former git-hooks/ validator scripts are removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bougyman
approved these changes
Sep 5, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements EXT-30: consolidates the repository Git hook architecture so that canonical check programs live under
ci/andgit-hooks/contains only the two thin lifecycle adapters.ci/validate_conventional_subject.sh— canonical subject validator (renamed fromgit-hooks/validate-conventional-subject; wasci/validate_conventional_commit.sh)ci/validate_pull_request_title.sh— canonical PR title guard (renamed fromgit-hooks/validate-pull-request-title)ci/validate_commit_range.sh— canonical commit-range checker (renamed fromgit-hooks/validate-commit-range)ci/validate_push_refs.sh— new canonical pre-push check; implements Git's pre-push stdin protocol (<local-ref> <local-sha> <remote-ref> <remote-sha>per line); skips deletions; handles new branches via merge-base withorigin/main; handles existing branches using remote SHA as base; preserves the GitHub Update-branch merge exceptiongit-hooks/commit-msg—exec "$repo_top/ci/validate_conventional_subject.sh" "$1"(adapter only)git-hooks/pre-push—exec "$repo_top/ci/validate_push_refs.sh" "$@"(adapter only, replaces formermix precommitcall)mix precommit— callsci/validate_pull_request_title.shandci/validate_commit_range.shdirectly.github/workflows/ci.yaml—conventional_commitsjob calls./ci/validate_commit_range.shdirectlyci/conventional_commits.sh,ci/validate_conventional_commit.sh(superseded by canonicalci/validate_*.shnames)Test plan
@subject_guard,@title_guard,@range_guardupdated toci/*.shpaths@push_refs_guardadded with tests: empty stdin, deletion skip, valid range, invalid range, new-branch modesetup_ci_worktree!createsci/directory in test worktree so scripts resolve$repo_top/ci/validate_conventional_subject.shcorrectlygit-hooks/contains exactly["commit-msg", "pre-push"]precommit_test.exsexpects./ci/validate_pull_request_title.shand./ci/validate_commit_range.shmix format --check-formattedcleanCloses EXT-30.
🤖 Generated with Claude Code