Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2090 +/- ##
=======================================
Coverage 98.26% 98.27%
=======================================
Files 61 61
Lines 2829 2836 +7
=======================================
+ Hits 2780 2787 +7
Misses 49 49 ☔ View full report in Codecov by Harness. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
schlotter
force-pushed
the
feature/base-commit-filter-hooks
branch
from
September 17, 2026 20:30
9ba70f0 to
0a593cd
Compare
12 tasks
schlotter
marked this pull request as ready for review
September 17, 2026 20:38
woile
approved these changes
Sep 18, 2026
woile
left a comment
Member
There was a problem hiding this comment.
LGTM
cc @noirbizarre @Lee-W @bearomorphism
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.
Description
Add convention-agnostic commit filtering hooks to
BaseCommitizen.Custom rules can now override one shared
filter_commitsmethod or theoperation-specific
filter_commits_before_bumpandfilter_commits_before_changelogmethods. The hooks run before bump calculationand changelog generation without changing the existing line-by-line
bump_patternbehavior.cz version --next USE_GIT_COMMITSuses the bump hook as well, so allcommit-derived version calculations remain consistent.
cz checkisintentionally unchanged.
This is an alternative implementation for
commitizen-tools/commitizen#2075
alongside
commitizen-tools/commitizen#2078.
Instead of adding a built-in filtering regex, it provides the generic extension
point proposed in the PR discussion.
Checklist
Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines
Code Changes
uv run poe alllocally to ensure this change passes linter check and teststest_bump_pre_commit_changelogcases could not install prettier/node intheir isolated hook environments because of local TLS certificate errors.
1,309 selected tests with 98% coverage.
Documentation Changes
uv run poe doc:buildlocally to ensure the documentation renders correctlyThe changed documentation also passes the
blacken-docsandcodespellpre-commit hooks.
Expected Behavior
Existing rules retain all commits by default, so current bump and changelog
behavior is unchanged.
A Python commit rule can override
filter_commitsto select commits using thefull commit message. Both bump calculation and changelog generation then process
only the selected commits. A rule can instead override an operation-specific
method when bump and changelog selection should differ.
Steps to Test This Pull Request
ConventionalCommitsCzand overridesfilter_commitsto select commits containingApplications: ['AppA'].featcommit and an AppAfixcommit after the current versiontag.
cz bump --get-nextand confirm the next version is a patch rather than aminor release.
cz version --project --next USE_GIT_COMMITSand confirm it reports thesame patch version.
cz changelog --dry-runand confirm only the AppA commit is included.available to bump and changelog processing.
Additional Context
The documentation includes a complete
ConventionalCommitsCzplugin examplethat reads a plugin-owned
app = "AppA"key from[tool.commitizen]and filtersthe full
Applications: [...]metadata line.This change does not add a core configuration setting, alter
cz check, modifyCHANGELOG.md, or update project versions.