Repository navigation
Closed
Description
Description
bump_map in pyproject.toml seems to be ignored. When I try to set "feat" to patch it still does consider it as a minor increment, and keep ignoring docs as an valid increment.
If I modify bump_pattern then the filter appear correctly so I suppose that the configuration are well read by the parser. The configuration for the changelog is correctly interpreted.
P.S. : Thanks for your work. I think I'm the problem with this issue, but I failed to know how...
Steps to reproduce
- Init a repo git (git init & uv init)
- Set the pyproject.toml
[project]
name = "error-commitizen"
version = "0.1.0"
description = "Replicate bug in commitizen ignoring pyproject.toml:bump_map configuration"
readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"commitizen>=4.10.1",
]
[tool.commitizen]
name = "cz_customize"
version_provider = "pep621" # Use version from pyproject.toml
update_changelog_on_bump = true
major_version_zero = true
changelog_incremental = true
version_files = [
"pyproject.toml:version",
]
allowed_prefixes = [
"Draft:",
"Merge",
"Revert",
"Pull request",
"fixup!",
"squash!",
"amend!"
]
breaking_change_exclamation_in_title = true
gpg_sign = false
annotated_tag = true
[tool.commitizen.customize]
# Commit message configuration
schema_pattern = "^(feat|fix|ci|chore|refactor|docs|test|perf|build|bump)(\\(#\\d+\\))?(!)?: ([A-Z].*)$"
# Bumping configuration => The bump_map DOES NOT WORK...
bump_pattern = "^(feat|fix|ci|chore|refactor|docs|test|perf|build|bump)"
bump_map = {feat = "PATCH", docs = "PATCH"}
- Create following git commits :
- Run
uv run cz bump --dry-run
Current behavior
A minor increment is operated.
Desired behavior
A patch increment should be operated.
Screenshots
No response
Environment
uv run cz version --report
Commitizen Version: 4.10.1
Python Version: 3.14.2 (main, Dec 9 2025, 19:03:14) [MSC v.1944 64 bit (AMD64)]
Operating System: Windows
Activity
bearomorphism commentedon May 9, 2026
Triage from #1964: Still valid on master (4.15.1). Root cause: when
major_version_zero = true,commitizen/commands/bump.py(lines 150-154) usesself.cz.bump_map_major_version_zeroinstead ofself.cz.bump_map. Incz_customize, you have to set both if you want a non-default mapping during 0.x. Workaround: addbump_map_major_version_zero = {feat = "PATCH", docs = "PATCH"}to your customize section. Long-term fix: when the user supplies a custombump_mapbut nobump_map_major_version_zero, derive the latter from it (withMAJORmapped toMINOR).bearomorphism commentedon May 9, 2026
Verification update (re #1964)
Reproduced against current master (4.15.1):
With
cz_customize,major_version_zero = true, andbump_map = {feat = "PATCH", docs = "PATCH", fix = "PATCH"}(onlybump_map, nobump_map_major_version_zero):cz bump --dry-run --yes→increment detected: MINOR❌ (the user'sbump_mapwas ignored)With both
bump_mapANDbump_map_major_version_zeroset to the same dict:cz bump --dry-run --yes→increment detected: PATCH✓Verdict: STILL VALID.
Root cause confirmed in
commitizen/commands/bump.py:150-154:When
major_version_zero=true, the user'sbump_mapis bypassed in favor ofbump_map_major_version_zero(which falls back to defaults if the user didn't set it).Workaround for users hitting this today: set both
bump_mapandbump_map_major_version_zeroin your customize section.Suggested fix: in
cz_customize.__init__, if the user suppliesbump_mapbut notbump_map_major_version_zero, derive the latter from the former (mapping anyMAJOR→MINOR). Same logic could apply at theBaseCommitizenlevel so other plugins benefit.fix(cz_customize): derive bump_map_major_version_zero from bump_map (#…