feat(parser): add bump and include_in_changelog flags - #1588
Conversation
|
Hey, have you tested this locally? I'm not sure what's the different between |
|
Yes, tested locally, on a throwaway repo. Config: [git]
conventional_commits = true
filter_unconventional = true
tag_pattern = "v[0-9]*"
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^chore", group = "Chores" },
{ message = "^docs", group = "Documentation", include_in_changelog = false },
]Repo: tagged
The docs commit is gone from the rendered output, but On Concretely, something
So Also ran the full test suite ( |
Allow commit parsers to separately control version bumping and changelog inclusion without hard-skipping matched commits (orhun#1579).
47cd737 to
2fbabcd
Compare
|
@orhun thanks — yes, the parser/config paths were exercised via the
|
Test suite failure was codecov CLI GPG verify (infra). Links failure is lychee 403 on gitlab.com commit URLs (auth wall), not PR docs. Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
|
@orhun Re-triggered CI. The two red checks look environmental rather than from this change:
Happy to wait on infra recovery or adjust if you prefer another approach. |
Description
Adds two orthogonal optional fields on
commit_parsers:bump = false— keep the commit in the changelog, exclude it from version bump calculationinclude_in_changelog = false— keep the commit for bump /filter_commitsmatching, omit it from changelog renderingskip = trueremains a hard drop. Defaults preserve existing behavior (both include when unset).Motivation and Context
Fixes #1579 (follow-up to the discussion in #1564 / #1520).
With
filter_commits = trueand onlyfeat/fixparsers, a release that only hasdocscommits currently reports nothing to bump. Matchingdocswithinclude_in_changelog = falselets bump see those commits while keeping them out of the changelog.This matches the two-flag design suggested in the issue discussion.
How Has This Been Tested?
cargo test -p git-cliff-core parse_commit_inclusion_flagscargo test -p git-cliff-core(70 passed; 1 unrelated failure:repo::test::git_upstream_remotewhen the feature branch has no upstream tracking remote configured)cargo +nightly fmt -p git-cliff-core -- --checkExample config:
Screenshots / Logs (if applicable)
Types of Changes
Checklist:
cargo +nightly fmt --allcargo clippy --tests --verbose -- -D warnings(pre-existing clippy failures onmaininchangelog.rsremotes progress-message branch; not introduced by this PR)cargo testMade with Cursor