Repository navigation
feat(ci): a gate keeps commit messages in the house style (#929) - #930
Merged
Merged
Conversation
Rebase-merge lands each message on main verbatim, so a defect that merges is permanent: fixing it means force-pushing main, moving release tags and stranding stellar-compose's submodule pin. Since 2026-08, 9 of 369 commits shipped with a subject wrapped onto line 2, one far past any length a log view shows, or a breaking change marked only one way. lib/commitMessage.ts is the pure checker, run as npm run commits:check. Errors are what the log shows going wrong: no lowercase type, a wrapped subject, over 100 characters before the (#NNN) suffix, WIP, and a leftover fixup! commit on a PR. Mood and breaking-change markers only warn, because the checker reads text, not the diff. Two callers, each naming its input by environment variable, and neither reading stdin (check-changelog.ts broke twice on fd 0): - .husky/commit-msg passes git's message file, and lets fixup! through at authorship, where it is a normal step towards --autosquash. - A Commit messages step in the required test job passes the PR's commits from the GitHub API, catching --no-verify, the web editor and bots. The API, not git, because the CI checkout is shallow. Existing history is not rewritten. Over the last 400 commits on main the gate reports the same 8 failures the audit in #929 found, and all 45 commits from the last 40 merged PRs pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Comprehensibility | 2 minor |
🟢 Metrics 39 complexity
Metric Results Complexity 39
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #929.
Rebase-merge lands each commit message on
mainverbatim, so a defect that merges is permanent. This adds a gate at the two points where a message can still be fixed. Existing history is not rewritten.What it adds
src/lib/commitMessage.ts: a pure checker, run asnpm run commits:check.(#NNN)suffix,WIP, and a leftoverfixup!commit on a PR.-ingsubjects, and a breaking change marked only one way (!with noBREAKING CHANGE:footer, or the reverse). It reads text, not the diff, so these cannot fail..husky/commit-msg: runs the check at authorship.fixup!passes here, as a step towards--autosquash.Commit messagesstep in thetestjob: checks the PR's commits, which it gets from the GitHub API because the checkout is shallow.testis already required, so branch protection is unchanged. It covers--no-verify, the web editor and bots.The script takes its input from environment variables and never reads stdin, so it avoids the fd 0 failures
check-changelog.tsdocuments.Verification
commitMessage.spec.ts: 26 tests built from real commits onmain. Breaking the suffix exclusion and the wrap check is caught by 2 of them.main, the gate reports the same 8 failures as the audit in Resolve verbose commit slop: gate commit messages at commit time and per-PR #929.🤖 Generated with Claude Code