Skip to content

chore: normalize commit messages#186

Draft
gregggreg wants to merge 2 commits into
marcus:docs-backfillfrom
gregggreg:nightshift/commit-normalize
Draft

chore: normalize commit messages#186
gregggreg wants to merge 2 commits into
marcus:docs-backfillfrom
gregggreg:nightshift/commit-normalize

Conversation

@gregggreg

@gregggreg gregggreg commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • normalize and validate Conventional Commit subjects in place
  • preserve message bodies, trailers, and Git-generated workflow messages
  • honor Git-generated comments using core.commentChar, core.commentString, or the default # prefix
  • enable repository-managed pre-commit and commit-msg hooks through .githooks
  • document the accepted format and add portable shell regression coverage

Format

Supported subjects use type(scope)!: summary, with optional scope and breaking-change marker. Supported types are build, chore, ci, docs, feat, fix, perf, refactor, style, and test.

The normalizer lowercases supported types, normalizes separator spacing, collapses repeated subject whitespace, trims surrounding blank lines, and removes trailing whitespace. Merge, revert, autosquash, stash, and comment-led Git-generated messages are preserved byte for byte.

Validation

  • make test (all Go tests and 16 normalizer regressions)
  • go vet ./...
  • go build ./...
  • sh -n scripts/normalize-commit-message.sh tests/commit-message-normalizer.sh .githooks/commit-msg .githooks/pre-commit
  • dash -n scripts/normalize-commit-message.sh tests/commit-message-normalizer.sh .githooks/commit-msg .githooks/pre-commit
  • normalizer regression suite under dash, including idempotence
  • git diff --check

Stack

This targets docs-backfill because the task required branching from the original checked-out branch. It should be reviewed after #104.

Nightshift-Task: commit-normalize
Nightshift-Ref: https://github.com/marcus/nightshift
@gregggreg
gregggreg force-pushed the nightshift/commit-normalize branch from 7530169 to ea52342 Compare July 15, 2026 09:14
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