Skip to content

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

Open
iamlasse wants to merge 1 commit into
marcus:mainfrom
iamlasse:feat/commit-normalize-impl
Open

feat(commits): add Conventional Commits message normalizer#207
iamlasse wants to merge 1 commit into
marcus:mainfrom
iamlasse:feat/commit-normalize-impl

Conversation

@iamlasse

@iamlasse iamlasse commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds a Conventional Commits message normalizer to the nightshift CLI.

  • internal/commits — pure, well-tested Normalize/validate functions enforcing the project's rules: known lowercase type prefix, lowercase (non-capitalized) subject, 72-char subject limit, comment/whitespace cleanup, and 72-column body wrapping. Idempotent.
  • CLI — nightshift commit normalize accepting a positional message, --file, or stdin, plus a --check validate-only flag. Non-zero exit on validation failure.
  • scripts/commit-msg.sh — a git commit-msg hook that rewrites the message file in place and rejects non-conformant messages.
  • docs/commit-messages.md — documents the format, allowed types, command examples, and hook installation.

Verification

  • go build ./...
  • go vet ./...
  • go test ./internal/commits/...
  • gofmt -l . (clean)

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
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