fix(cz): enforce blank line between subject and body#75
Closed
Conversation
The Conventional Commits spec requires: "body MUST begin one blank line after the description." Single-line messages (no body) are unaffected.
5cc20b1 to
ade7e83
Compare
Contributor
📊 Coverage Report
|
vabatta
added a commit
that referenced
this pull request
Mar 9, 2026
The Conventional Commits spec requires: "body MUST begin one blank line after the description." Single-line messages (no body) are unaffected. Closes #75.
Contributor
Author
|
Folded into #76 (spec alignment PR) — the blank line enforcement is now included there with error code |
6 tasks
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.
Summary
docs: correct spelling of CHANGELOGstill passesChanges
cmd_lint.sh: After parsing the first line, check if the message has a second line. If it does and it's not blank, reject with the spec-quoted error message.The check uses pure bash string manipulation — strips the first line via
${message#*$'\n'}and checks if what remains starts with a non-empty line.Test plan
accepts single-line message (no body)—docs: correct spelling of CHANGELOGaccepts message with blank line before body— spec example with bodyrejects body without blank line separator— spec example without blank linerejects footer without blank line separator—BREAKING CHANGE:footer without blank lineaccepts message with only a trailing newline— edge case