Skip to content

bump_map in pyproject.toml seems to be ignored #1728

Description

@JeannotJeannot

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

  1. Init a repo git (git init & uv init)
  2. 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"}
  1. Create following git commits :
Image
  1. Run uv run cz bump --dry-run
Image

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

  1. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Triage from #1964: Still valid on master (4.15.1). Root cause: when major_version_zero = true, commitizen/commands/bump.py (lines 150-154) uses self.cz.bump_map_major_version_zero instead of self.cz.bump_map. In cz_customize, you have to set both if you want a non-default mapping during 0.x. Workaround: add bump_map_major_version_zero = {feat = "PATCH", docs = "PATCH"} to your customize section. Long-term fix: when the user supplies a custom bump_map but no bump_map_major_version_zero, derive the latter from it (with MAJOR mapped to MINOR).

  2. bearomorphism commented on May 9, 2026

    @bearomorphism
    Collaborator

    Verification update (re #1964)

    Reproduced against current master (4.15.1):

    With cz_customize, major_version_zero = true, and bump_map = {feat = "PATCH", docs = "PATCH", fix = "PATCH"} (only bump_map, no bump_map_major_version_zero):

    • cz bump --dry-run --yes → increment detected: MINOR ❌ (the user's bump_map was ignored)

    With both bump_map AND bump_map_major_version_zero set 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:

    bump_map = (
        self.cz.bump_map_major_version_zero
        if self.bump_settings["major_version_zero"]
        else self.cz.bump_map
    )

    When major_version_zero=true, the user's bump_map is bypassed in favor of bump_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_map and bump_map_major_version_zero in your customize section.

    Suggested fix: in cz_customize.__init__, if the user supplies bump_map but not bump_map_major_version_zero, derive the latter from the former (mapping any MAJOR → MINOR). Same logic could apply at the BaseCommitizen level so other plugins benefit.

  3. added a commit that references this issue on May 15, 2026
    3f8b8ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions