fix: parse multi-line commit messages without errors#83
Merged
zachdaniel merged 3 commits intozachdaniel:masterfrom Apr 8, 2026
Merged
fix: parse multi-line commit messages without errors#83zachdaniel merged 3 commits intozachdaniel:masterfrom
zachdaniel merged 3 commits intozachdaniel:masterfrom
Conversation
…mit header Previously, the entire multi-line commit message was passed to the NimbleParsec parser, which would misinterpret body text (e.g. dependabot YAML metadata like `dependency-type: direct:production`) as additional conventional commits, causing parse failures. Now the parser splits messages line-by-line: the first line must parse as a valid conventional commit or the whole message is rejected. Remaining lines are tried individually — successful parses become additional commits, failures become body text for the preceding commit.
zachdaniel
reviewed
Apr 7, 2026
test/commit_test.exs
Outdated
|
|
||
| commit = parse_one!(text) | ||
| assert commit.breaking? | ||
| assert commit.body == "BREAKING CHANGE: The v1 API has been removed." |
Owner
There was a problem hiding this comment.
Should the "Users must migrate to v2." not be considered part of the body?
zachdaniel
reviewed
Apr 7, 2026
.gitignore
Outdated
|
|
||
| /.elixir_ls/ | ||
| /.elixir-tools/ | ||
| .claude |
Owner
There was a problem hiding this comment.
I typically prefer to keep these out of our project's gitignore files in favor of them living in people's personal settings.
Previously `build_commit` split body lines into separate `body` and `footer` fields, losing content beyond the second paragraph. Now all non-header lines are joined into `body`. Also disables GitHub API lookups in release tests to prevent rate-limit-induced timeouts.
deb04c2 to
f9dbcc3
Compare
Owner
|
🚀 Thank you for your contribution! 🚀 |
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
Commit.parse/2to parse commit messages line-by-line instead of passing the full text to NimbleParsecdependency-type: direct:productionwas misinterpreted as a conventional commit patternTest plan
BREAKING CHANGE:detection in body:error