Skip to content

chore(commits): install commit-msg hook via make install-hooks - #209

Open
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:chore/commit-normalize
Open

chore(commits): install commit-msg hook via make install-hooks#209
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:chore/commit-normalize

Conversation

@iamlasse

@iamlasse iamlasse commented Aug 9, 2026

Copy link
Copy Markdown

Summary

Finishes the Commit Message Normalizer feature by wiring up the already-implemented nightshift commit normalize tooling so it is enforced out of the box, and documenting it.

Problem

The normalizer library (internal/commits), the nightshift commit normalize CLI command, the scripts/commit-msg.sh enforcement hook, and docs/commit-messages.md all exist — but Conventional Commits enforcement was invisible by default:

  • make install-hooks wired up only scripts/pre-commit.sh and never installed scripts/commit-msg.sh, so the normalizer was never active on commits.
  • The README documented only the pre-commit hook.

Changes

  • Makefileinstall-hooks now also symlinks scripts/commit-msg.sh into .git/hooks/commit-msg (in addition to pre-commit). Help text in both the install-hooks target and the help target updated to say "git pre-commit and commit-msg hooks".
  • README.md — renamed the "Pre-commit hooks" section to "Git hooks" and added a paragraph documenting that make install-hooks also installs a commit-msg hook that enforces/rewrites Conventional Commits via nightshift commit normalize, linking to docs/commit-messages.md.

No new library logic — the normalizer and CLI are unchanged. This branch also carries the existing normalizer commit (feat(commits): add Conventional Commits message normalizer) since it is not yet on main.

Verification

  • go test ./internal/commits/... — green
  • go build ./... — compiles
  • make install-hooks — both .git/hooks/pre-commit and .git/hooks/commit-msg symlinked to scripts/
  • This commit's message was normalized by the very commit-msg hook being wired up here ✓

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift


Automated by nightshift

iamlasse added 2 commits June 28, 2026 02:10
Add internal/commits with pure Normalize/validate functions enforcing the project's Conventional Commits rules (known type set, lowercase type, lowercase subject, 72-char subject limit, whitespace trimming, and 72-column body wrapping). Wire it into the CLI as 'nightshift commit normalize' (positional, --file, and stdin sources; --check to validate only), ship a commit-msg git hook under scripts/, and document the format and installation in docs/commit-messages.md.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
Wire scripts/commit-msg.sh into 'make install-hooks' so the Conventional
Commits normalizer is enforced (and installed) out of the box, alongside
the existing pre-commit hook. Update the Makefile help text and the
README hooks section to document both hooks.

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