diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ba24a07e66..4ec740e2fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: - tomli - repo: https://github.com/commitizen-tools/commitizen - rev: v4.13.8 # automatically updated by Commitizen + rev: v4.13.9 # automatically updated by Commitizen hooks: - id: commitizen - id: commitizen-branch diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab2bc2481..31bbd5a29f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v4.13.9 (2026-02-25) + +### Fix + +- avoid raising an exception when a change_type is not defined (#1879) + ## v4.13.8 (2026-02-18) ### Fix diff --git a/commitizen/__version__.py b/commitizen/__version__.py index 061dda4064..c7a3dc0c86 100644 --- a/commitizen/__version__.py +++ b/commitizen/__version__.py @@ -1 +1 @@ -__version__ = "4.13.8" +__version__ = "4.13.9" diff --git a/commitizen/changelog.py b/commitizen/changelog.py index 8d01bebc17..d8b8acccae 100644 --- a/commitizen/changelog.py +++ b/commitizen/changelog.py @@ -193,7 +193,7 @@ def process_commit_message( messages = [processed_msg] if isinstance(processed_msg, dict) else processed_msg for msg in messages: change_type = msg.pop("change_type", None) - if change_type_map: + if change_type_map and change_type: change_type = change_type_map.get(change_type, change_type) ref_changes[change_type].append(msg) diff --git a/docs/commands/bump.md b/docs/commands/bump.md index cbd6d5452b..51293bca4b 100644 --- a/docs/commands/bump.md +++ b/docs/commands/bump.md @@ -1,4 +1,4 @@ -![Bump version](../images/bump.gif) +![Bump version](../images/cli_interactive/bump.gif) ## About diff --git a/docs/images/bump.gif b/docs/images/bump.gif deleted file mode 100644 index 0e97550ade..0000000000 Binary files a/docs/images/bump.gif and /dev/null differ diff --git a/docs/images/bump.tape b/docs/images/bump.tape new file mode 100644 index 0000000000..08003602e2 --- /dev/null +++ b/docs/images/bump.tape @@ -0,0 +1,134 @@ +Output cli_interactive/bump.gif + +Require cz + +# Use bash for cross-platform compatibility (macOS, Linux, Windows) +Set Shell bash + +Set FontSize 16 +Set Width 878 +Set Height 568 +Set Padding 20 +Set TypingSpeed 50ms + +Set Theme { + "name": "Commitizen", + "black": "#232628", + "red": "#fc4384", + "green": "#b3e33b", + "yellow": "#ffa727", + "blue": "#75dff2", + "magenta": "#ae89fe", + "cyan": "#708387", + "white": "#d5d5d0", + "brightBlack": "#626566", + "brightRed": "#ff7fac", + "brightGreen": "#c8ed71", + "brightYellow": "#ebdf86", + "brightBlue": "#75dff2", + "brightMagenta": "#ae89fe", + "brightCyan": "#b1c6ca", + "brightWhite": "#f9f9f4", + "background": "#1e1e2e", + "foreground": "#afafaf", + "cursor": "#c7c7c7" +} + +# Hide initial shell prompt +Hide + +# Wait for terminal to be ready +Sleep 1s + +# Set a clean, simple prompt (while hidden) +Type "PS1='$ '" +Enter +Sleep 300ms + +# Create a clean temporary directory for recording +Type "rm -rf /tmp/commitizen-example && mkdir -p /tmp/commitizen-example && cd /tmp/commitizen-example" +Enter +Sleep 500ms + +# Initialize git repository +Type "git init" +Enter +Type "git config user.email 'you@example.com'" +Enter +Type "git config user.name 'Your Name'" +Enter +Sleep 500ms + +# Initialize commitizen config with version 0.0.1 and changelog enabled +Type `cat > pyproject.toml << 'EOF'` +Enter +Sleep 100ms +Type `[tool.commitizen]` +Enter +Sleep 100ms +Type `version = "0.0.1"` +Enter +Sleep 100ms +Type `update_changelog_on_bump = true` +Enter +Sleep 100ms +Type "EOF" +Enter +Sleep 300ms + +# Create initial commit (no tag, so cz bump will ask "Is this the first tag created?") +Type "git add pyproject.toml" +Enter +Sleep 300ms + +Type "git commit -m 'chore: initial commit'" +Enter +Sleep 500ms + +# Create a feat commit that will trigger a MINOR bump (0.0.1 -> 0.1.0) +Type "echo 'new feature' > feature.py" +Enter +Sleep 300ms + +Type "git add feature.py" +Enter +Sleep 300ms + +Type "git commit -m 'feat: add awesome new feature'" +Enter +Sleep 500ms + +# Clear the screen to start fresh +Type "clear" +Enter +Sleep 500ms + +# Show commands from here +Show + +# Step 1: Show current version +Type "cz version --project" +Sleep 500ms +Enter +Sleep 1s + +# Step 2: Run cz bump (no existing tag, will prompt for first tag) +Type "cz bump" +Sleep 500ms +Enter + +# Wait for the "Is this the first tag created?" prompt +Sleep 2s + +# Answer Yes to "Is this the first tag created?" (default is Yes, just press Enter) +Enter +Sleep 3s + +# Step 3: Show new version after bump +Type "cz version --project" +Sleep 500ms +Enter +Sleep 1s + +# Wait for final output +Sleep 3s diff --git a/docs/images/cli_interactive/bump.gif b/docs/images/cli_interactive/bump.gif new file mode 100644 index 0000000000..e452e6d8db Binary files /dev/null and b/docs/images/cli_interactive/bump.gif differ diff --git a/docs/images/cli_interactive/commit.gif b/docs/images/cli_interactive/commit.gif index 12b62cd223..a03139f480 100644 Binary files a/docs/images/cli_interactive/commit.gif and b/docs/images/cli_interactive/commit.gif differ diff --git a/docs/images/cli_interactive/init.gif b/docs/images/cli_interactive/init.gif index 2f8a01f8b0..bc90592c07 100644 Binary files a/docs/images/cli_interactive/init.gif and b/docs/images/cli_interactive/init.gif differ diff --git a/docs/images/commit.tape b/docs/images/commit.tape index 42aa25a023..f05a354e7b 100644 --- a/docs/images/commit.tape +++ b/docs/images/commit.tape @@ -53,6 +53,10 @@ Sleep 500ms # Initialize git repository Type "git init" Enter +Type "git config user.email 'you@example.com'" +Enter +Type "git config user.name 'Your Name'" +Enter Sleep 500ms Type "git checkout -b awesome-feature" diff --git a/pyproject.toml b/pyproject.toml index 2670a0d857..64f7d7c914 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "commitizen" -version = "4.13.8" +version = "4.13.9" description = "Python commitizen client tool" authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }] maintainers = [ diff --git a/uv.lock b/uv.lock index 12e9c4dfb0..60869fbb11 100644 --- a/uv.lock +++ b/uv.lock @@ -195,7 +195,7 @@ wheels = [ [[package]] name = "commitizen" -version = "4.13.8" +version = "4.13.9" source = { editable = "." } dependencies = [ { name = "argcomplete" },