Skip to content

feat(commits): add Conventional Commits message normalizer - #217

Open
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:feat/commit-message-normalizer-20260817
Open

feat(commits): add Conventional Commits message normalizer#217
iamlasse wants to merge 2 commits into
marcus:mainfrom
iamlasse:feat/commit-message-normalizer-20260817

Conversation

@iamlasse

Copy link
Copy Markdown

Summary

Standardize the project's commit message format with Conventional Commits:

  • internal/commits — pure, well-tested Normalize() enforcing the known type set, lowercase type, lowercase subject, 72-char subject limit, whitespace trimming, and 72-column body wrapping. Capitalized subjects are rejected rather than silently rewritten so the author keeps control of wording.
  • nightshift commit normalize — CLI subcommand accepting a positional message, --file, or stdin, with --check for validation-only (used by the hook).
  • scripts/commit-msg.sh — commit-msg git hook that normalizes the message in place and exits non-zero on unrecoverable violations.
  • make install-hooks — now installs the commit-msg hook alongside the existing pre-commit hook; README development section updated and links to docs/commit-messages.md.

Testing

  • gofmt, go build ./..., go vet ./..., go test ./... all pass
  • Smoke-tested nightshift commit normalize ' FEAT(ui): render button. 'feat(ui): render button
  • Malformed messages exit non-zero via both the CLI and the hook
  • This PR's commits were made with both hooks installed (pre-commit checks + commit-msg normalization verified live)

🤖 Generated with Claude Code

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

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
Extend the install-hooks target to symlink scripts/commit-msg.sh into
.git/hooks/commit-msg alongside the existing pre-commit hook, and update
the README development section to describe the commit-msg normalizer
hook and link to docs/commit-messages.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