Skip to content

feat(hooks): add commit-msg hook to normalize commit messages - #219

Open
ke23y wants to merge 1 commit into
marcus:mainfrom
ke23y:feat/commit-normalize-hook-v5
Open

feat(hooks): add commit-msg hook to normalize commit messages#219
ke23y wants to merge 1 commit into
marcus:mainfrom
ke23y:feat/commit-normalize-hook-v5

Conversation

@ke23y

@ke23y ke23y commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Adds scripts/commit-msg.sh, a Conventional Commits validator for the commit subject line, matching the existing scripts/pre-commit.sh style (set -euo pipefail, ✓/✗ output, exit 1 on failure, --no-verify escape hatch).
  • Wires it into make install-hooks alongside the existing pre-commit hook, and updates the help text.
  • Documents the convention (<type>(<scope>)?: <description>, allowed types) in AGENTS.md under Conventions.
  • Merge and revert commits are allowed through untouched so normal GitHub merge workflows aren't blocked.

Test plan

  • bash -n scripts/commit-msg.sh
  • Ran the hook against a conforming subject (fix(budget): correct rollover calc) — passes
  • Ran the hook against a non-conforming subject (Fixed the budget thing) — fails with a clear message
  • Ran the hook against a merge commit subject — passes
  • make install-hooks installs both .git/hooks/pre-commit and .git/hooks/commit-msg symlinks
  • go build ./... and go vet ./... pass (no Go code touched)
  • This PR's own commit was made with both hooks installed and passed both checks

Automated by nightshift

Adds a Conventional Commits validator matching the existing
pre-commit.sh style, wires it into `make install-hooks`, and
documents the convention in AGENTS.md.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant