From 9473ef3c83bb90f9e398462b84aa70913192d668 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 11 Dec 2025 15:24:38 +0000 Subject: [PATCH 1/7] docs(cli/screenshots): update CLI screenshots [skip ci] --- docs/images/cli_help/cz_version___help.svg | 90 ++++++++++++---------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/docs/images/cli_help/cz_version___help.svg b/docs/images/cli_help/cz_version___help.svg index 7ddec177d..a8e0bd844 100644 --- a/docs/images/cli_help/cz_version___help.svg +++ b/docs/images/cli_help/cz_version___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + - + - + - - $ cz version --help -usage: cz version [-h][-r | -p | -c | -v][--major | --minor] - -get the version of the installed commitizen or the current project (default: -installed commitizen) - -options: -  -h, --help        show this help message and exit -  -r, --report      get system information for reporting bugs -  -p, --project     get the version of the current project -  -c, --commitizen  get the version of the installed commitizen -  -v, --verbose     get the version of both the installed commitizen and the -                    current project -  --major           get just the major version -  --minor           get just the minor version - + + $ cz version --help +usage: cz version [-h][-r | -p | -c | -v][--major | --minor] + +get the version of the installed commitizen or the current project (default: +installed commitizen) + +options: +  -h, --help        show this help message and exit +  -r, --report      get system information for reporting bugs +  -p, --project     get the version of the current project +  -c, --commitizen  get the version of the installed commitizen +  -v, --verbose     get the version of both the installed commitizen and the +                    current project +  --major           get just the major version. Need to be used with --project +                    or --verbose. +  --minor           get just the minor version. Need to be used with --project +                    or --verbose. + From c2ae121f848c77df906d2208cd17c2c311d01118 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 11 Dec 2025 15:24:40 +0000 Subject: [PATCH 2/7] =?UTF-8?q?bump:=20version=204.10.0=20=E2=86=92=204.10?= =?UTF-8?q?.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ commitizen/__version__.py | 2 +- pyproject.toml | 4 ++-- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bf207ea60..f70fbf2f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,7 +48,7 @@ repos: - tomli - repo: https://github.com/commitizen-tools/commitizen - rev: v4.10.0 # automatically updated by Commitizen + rev: v4.10.1 # automatically updated by Commitizen hooks: - id: commitizen - id: commitizen-branch diff --git a/CHANGELOG.md b/CHANGELOG.md index f8bca478b..7ee748085 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +## v4.10.1 (2025-12-11) + +### Fix + +- **version**: fix the behavior of cz version --major +- **cli**: debug and no_raise can be used together in sys.excepthook +- **git**: replace lstrip with strip for compatibility issue +- **bump**: remove NotAllowed related to --get-next option, other related refactoring + +### Refactor + +- **version**: rename class member to align with other classes +- **cargo_provider**: cleanup and get rid of potential type errors +- **bump**: extract option validation and new version resolution to new functions +- **changelog**: raise NotAllow when file_name not passed instead of using assert +- **bump**: rename parameter and variables + +### Perf + +- **ruff**: enable ruff rules TC001~TC006 +- add TYPE_CHECKING to CzQuestion imports + ## v4.10.0 (2025-11-10) ### Feat diff --git a/commitizen/__version__.py b/commitizen/__version__.py index 897e6be2f..4e499ea83 100644 --- a/commitizen/__version__.py +++ b/commitizen/__version__.py @@ -1 +1 @@ -__version__ = "4.10.0" +__version__ = "4.10.1" diff --git a/pyproject.toml b/pyproject.toml index 7ea99cc69..3e9c45ae6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "commitizen" -version = "4.10.0" +version = "4.10.1" description = "Python commitizen client tool" authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }] maintainers = [ @@ -121,7 +121,7 @@ build-backend = "poetry.core.masonry.api" [tool.commitizen] -version = "4.10.0" +version = "4.10.1" tag_format = "v$version" version_files = [ "pyproject.toml:version", From 2b0b4d89e7d24efa211411ae733ddbfdbf64efa9 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Fri, 12 Dec 2025 00:31:15 +0800 Subject: [PATCH 3/7] docs: add missing site_url --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index ac1fbfa09..fe42da177 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,5 @@ site_name: Commitizen +site_url: https://commitizen-tools.github.io/commitizen/ site_description: commit rules, semantic version, conventional commits theme: From 30bb513b993cec111abf255f666ee190f4041530 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Fri, 12 Dec 2025 00:22:15 +0800 Subject: [PATCH 4/7] build: add missing dark mode back --- mkdocs.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index fe42da177..656e8dd42 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,9 +3,8 @@ site_url: https://commitizen-tools.github.io/commitizen/ site_description: commit rules, semantic version, conventional commits theme: - name: "material" + name: material palette: - - primary: 'deep purple' # Palette toggle for automatic mode - media: "(prefers-color-scheme)" toggle: @@ -15,6 +14,7 @@ theme: # Palette toggle for light mode - media: "(prefers-color-scheme: light)" scheme: default + primary: deep purple toggle: icon: material/brightness-7 name: Switch to dark mode @@ -22,6 +22,7 @@ theme: # Palette toggle for dark mode - media: "(prefers-color-scheme: dark)" scheme: slate + primary: deep purple toggle: icon: material/brightness-4 name: Switch to system preference From 1e5869ec87c3886e1e2d313fd9d3d273db974b33 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Fri, 12 Dec 2025 00:42:12 +0800 Subject: [PATCH 5/7] style(mkdocs.yml): make indent consistent in nav section --- mkdocs.yml | 80 +++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 656e8dd42..9666a203d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -34,53 +34,53 @@ edit_uri: "" nav: - Introduction: "README.md" - Commands: - - init: "commands/init.md" - - commit: "commands/commit.md" - - bump: "commands/bump.md" - - check: "commands/check.md" - - changelog: "commands/changelog.md" - - example: "commands/example.md" - - info: "commands/info.md" - - ls: "commands/ls.md" - - schema: "commands/schema.md" - - version: "commands/version.md" + - init: "commands/init.md" + - commit: "commands/commit.md" + - bump: "commands/bump.md" + - check: "commands/check.md" + - changelog: "commands/changelog.md" + - example: "commands/example.md" + - info: "commands/info.md" + - ls: "commands/ls.md" + - schema: "commands/schema.md" + - version: "commands/version.md" - Configuration: - - Configuration File: "config/configuration_file.md" - - Version Provider: "config/version_provider.md" - - bump: "config/bump.md" - - commit: "config/commit.md" - - check: "config/check.md" - - changelog: "config/changelog.md" - - Misc Options: "config/option.md" + - Configuration File: "config/configuration_file.md" + - Version Provider: "config/version_provider.md" + - bump: "config/bump.md" + - commit: "config/commit.md" + - check: "config/check.md" + - changelog: "config/changelog.md" + - Misc Options: "config/option.md" - Advanced Customization: - - Configuration File: "customization/config_file.md" - - Customized Python Class: "customization/python_class.md" - - Changelog Template: "customization/changelog_template.md" + - Configuration File: "customization/config_file.md" + - Customized Python Class: "customization/python_class.md" + - Changelog Template: "customization/changelog_template.md" - Tutorials: - - Writing commits: "tutorials/writing_commits.md" - - Managing tags formats: "tutorials/tag_format.md" - - Auto check commits: "tutorials/auto_check.md" - - Auto prepare commit message: "tutorials/auto_prepare_commit_message.md" - - GitLab CI: "tutorials/gitlab_ci.md" - - GitHub Actions: "tutorials/github_actions.md" - - Jenkins pipeline: "tutorials/jenkins_pipeline.md" - - Developmental releases: "tutorials/dev_releases.md" - - Monorepo support: "tutorials/monorepo_guidance.md" + - Writing commits: "tutorials/writing_commits.md" + - Managing tags formats: "tutorials/tag_format.md" + - Auto check commits: "tutorials/auto_check.md" + - Auto prepare commit message: "tutorials/auto_prepare_commit_message.md" + - GitLab CI: "tutorials/gitlab_ci.md" + - GitHub Actions: "tutorials/github_actions.md" + - Jenkins pipeline: "tutorials/jenkins_pipeline.md" + - Developmental releases: "tutorials/dev_releases.md" + - Monorepo support: "tutorials/monorepo_guidance.md" - FAQ: "faq.md" - Features we won't add: "features_wont_add.md" - Exit Codes: "exit_codes.md" - Third-Party Commitizen Plugins: - - About: "third-party-plugins/about.md" - # Please sort the plugins alphabetically - - "third-party-plugins/commitizen-deno-provider.md" - - "third-party-plugins/commitizen-emoji.md" - - "third-party-plugins/conventional-jira.md" - - "third-party-plugins/cz-ai.md" - - "third-party-plugins/cz-conventional-gitmoji.md" - - "third-party-plugins/cz-emoji.md" - - "third-party-plugins/cz-legacy.md" - - "third-party-plugins/cz-path.md" - - "third-party-plugins/github-jira-conventional.md" + - About: "third-party-plugins/about.md" + # Please sort the plugins alphabetically + - "third-party-plugins/commitizen-deno-provider.md" + - "third-party-plugins/commitizen-emoji.md" + - "third-party-plugins/conventional-jira.md" + - "third-party-plugins/cz-ai.md" + - "third-party-plugins/cz-conventional-gitmoji.md" + - "third-party-plugins/cz-emoji.md" + - "third-party-plugins/cz-legacy.md" + - "third-party-plugins/cz-path.md" + - "third-party-plugins/github-jira-conventional.md" - Contributing: "contributing.md" - Contributing TL;DR: "contributing_tldr.md" - Resources: "external_links.md" From c0da2e6824ce30273bc84ddccf82681e137fa9c4 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Fri, 12 Dec 2025 12:00:38 +0800 Subject: [PATCH 6/7] docs: fix some format issues in docs --- docs/config/bump.md | 22 +++++++++++----------- docs/config/version_provider.md | 8 ++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/docs/config/bump.md b/docs/config/bump.md index fa46e18f8..10ca5bcf8 100644 --- a/docs/config/bump.md +++ b/docs/config/bump.md @@ -185,11 +185,11 @@ version_files = [ ```json title="setup.json" { - "name": "magictool", - "version": "1.2.3", - "dependencies": { - "lodash": "1.2.3" - } + "name": "magictool", + "version": "1.2.3", + "dependencies": { + "lodash": "1.2.3" + } } ``` @@ -197,12 +197,12 @@ version_files = [ ```diff title="setup.json" { - "name": "magictool", - - "version": "1.2.3", - + "version": "2.0.0", - "dependencies": { - "lodash": "1.2.3" - } + "name": "magictool", + - "version": "1.2.3", + + "version": "2.0.0", + "dependencies": { + "lodash": "1.2.3" + } } ``` diff --git a/docs/config/version_provider.md b/docs/config/version_provider.md index 4f070b2fd..859f84f78 100644 --- a/docs/config/version_provider.md +++ b/docs/config/version_provider.md @@ -19,6 +19,7 @@ Commitizen includes several built-in version providers for common package manage The default version provider stores and retrieves the version from your Commitizen configuration file (e.g., `pyproject.toml`, `.cz.toml`, etc.). **Use when:** + - You want to keep version management separate from your package manager - Your project doesn't use a standard package manager - You need maximum flexibility in version management @@ -35,6 +36,7 @@ version = "0.1.0" # Required when using this provider Fetches the version from Git tags using `git describe`. This provider **only reads** version information and never writes it back to files. It's designed to work with tools like `setuptools-scm` or other package manager `*-scm` plugins that derive version numbers from Git history. **Use when:** + - You're using `setuptools-scm` or similar tools - You want version numbers derived from Git tags - You don't want Commitizen to modify any files for version management @@ -54,6 +56,7 @@ version_provider = "scm" Manages version in `pyproject.toml` under the `project.version` field, following [PEP 621](https://peps.python.org/pep-0621/) standards. **Use when:** + - You're using a modern Python project with PEP 621-compliant `pyproject.toml` - You want version management integrated with your Python project metadata @@ -75,6 +78,7 @@ version = "0.1.0" # Managed by Commitizen Manages version in `pyproject.toml` under the `tool.poetry.version` field, which is used by the [Poetry](https://python-poetry.org/) package manager. This approach is recommended only for users running Poetry versions earlier than 2.0 or relying on Poetry-specific features. For most users on Poetry 2.0 or later, it is recommended to use `pep621` instead. [Read More](https://python-poetry.org/docs/main/managing-dependencies/) **Use when:** + - You're using Poetry < 2.0 as your Python package manager - You're using Poetry >= 2.0 as your Python package manager, but don't need poetry-specific features - You want Commitizen to manage the version that Poetry uses @@ -101,6 +105,7 @@ Manages version in both `pyproject.toml` (`project.version`) and `uv.lock` (`pac Even though uv follows PEP 621 format, `pep621` does not manage the version in `uv.lock`. `uv` is still suggested for uv users. **Use when:** + - You're using `uv` as your Python package manager - You want version synchronization between `pyproject.toml` and `uv.lock` @@ -115,6 +120,7 @@ version_provider = "uv" Manages version in both `Cargo.toml` (`package.version`) and `Cargo.lock` (`package.version` for the matching package name). This ensures consistency between your Rust project's manifest and lock file. **Use when:** + - You're working with a Rust project using Cargo - You want Commitizen to manage Rust package versions @@ -136,6 +142,7 @@ version = "0.1.0" # Managed by Commitizen Manages version in `package.json` and optionally synchronizes with `package-lock.json` and `npm-shrinkwrap.json` if they exist. **Use when:** + - You're working with a Node.js/JavaScript project - You want Commitizen to manage npm package versions @@ -158,6 +165,7 @@ version_provider = "npm" Manages version in `composer.json` under the `version` field, used by PHP's Composer package manager. **Use when:** + - You're working with a PHP project using Composer - You want Commitizen to manage Composer package versions From b64c6f675808590c98b8b127db886b7a7b6d0ae8 Mon Sep 17 00:00:00 2001 From: Parker Date: Sat, 13 Dec 2025 23:13:19 +0900 Subject: [PATCH 7/7] docs: fix broken links in doc --- docs/README.md | 6 +++--- docs/external_links.md | 2 +- docs/faq.md | 2 +- docs/tutorials/github_actions.md | 11 ++++++----- docs/tutorials/writing_commits.md | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docs/README.md b/docs/README.md index fa3fab223..3b8fd7fb6 100644 --- a/docs/README.md +++ b/docs/README.md @@ -45,7 +45,7 @@ This standardization makes your commit history more readable and meaningful, whi - Intelligent [version bumping](https://commitizen-tools.github.io/commitizen/commands/bump/) using [Semantic Versioning][semver] - Automatic [keep a changelog][keepchangelog] generation - Built-in commit validation with pre-commit hooks -- [Customizable](https://commitizen-tools.github.io/commitizen/customization/) commit rules and templates +- [Customizable](https://commitizen-tools.github.io/commitizen/customization/config_file/) commit rules and templates - Multi-format version file support - Custom rules and plugins via pip @@ -174,7 +174,7 @@ You can customize: - [Version files](https://commitizen-tools.github.io/commitizen/commands/bump/#version_files) - [Version scheme](https://commitizen-tools.github.io/commitizen/commands/bump/#version_scheme) -- [Version provider](https://commitizen-tools.github.io/commitizen/config/#version-providers) +- [Version provider](https://commitizen-tools.github.io/commitizen/config/version_provider/) For all available options, see the [bump command documentation](https://commitizen-tools.github.io/commitizen/commands/bump/). @@ -249,7 +249,7 @@ Commitizen provides a comprehensive CLI with various commands. Here's the comple - [Conventional Commits Specification][conventional_commits] - [Exit Codes Reference](https://commitizen-tools.github.io/commitizen/exit_codes/) -- [Configuration Guide](https://commitizen-tools.github.io/commitizen/config/) +- [Configuration Guide](https://commitizen-tools.github.io/commitizen/config/configuration_file/) - [Command Documentation](https://commitizen-tools.github.io/commitizen/commands/init/) ### Getting Help diff --git a/docs/external_links.md b/docs/external_links.md index 1b5efb05d..9c3075877 100644 --- a/docs/external_links.md +++ b/docs/external_links.md @@ -14,6 +14,6 @@ - [Python Table Manners - Commitizen: 規格化 commit message](https://blog.wei-lee.me/posts/tech/2020/03/python-table-manners-commitizen/) (Written in Traditional Mandarin) - [Automating semantic release with commitizen](https://woile.dev/posts/automating-semver-releases-with-commitizen/) (English) - [How to Write Better Git Commit Messages – A Step-By-Step Guide](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/?utm_source=tldrnewsletter) (English) -- [Continuous delivery made easy (in Python)](https://medium.com/dev-genius/continuous-delivery-made-easy-in-python-c085e9c82e69) +- [Continuous delivery made easy (in Python)](https://blog.devgenius.io/continuous-delivery-made-easy-in-python-c085e9c82e69) [automatizando]: https://youtu.be/t3aE2M8UPBo diff --git a/docs/faq.md b/docs/faq.md index 9de0c43e4..fba72325b 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -120,7 +120,7 @@ If you would like to learn more about both schemes, there are plenty of good res - [API Versioning from Stripe](https://stripe.com/blog/api-versioning) - [Discussion about pip's use of CalVer](https://github.com/pypa/pip/issues/5645#issuecomment-407192448) - [Git Version Numbering](https://code.erpenbeck.io/git/2021/12/16/git-version-numbering/) -- [SemVer vs. CalVer and Why I Use Both](https://mikestaszel.com/2021/04/03/semver-vs-calver-and-why-i-use-both/) (but not at the same time) +- [SemVer vs. CalVer and Why I Use Both](https://mikestaszel.com/post/semver-vs-calver-and-why-i-use-both/) (but not at the same time) - [Semver Will Not Save You](https://hynek.me/articles/semver-will-not-save-you/) - [Why I Don't Like SemVer](https://snarky.ca/why-i-dont-like-semver/) diff --git a/docs/tutorials/github_actions.md b/docs/tutorials/github_actions.md index 2cb58cfee..f15b62fba 100644 --- a/docs/tutorials/github_actions.md +++ b/docs/tutorials/github_actions.md @@ -113,13 +113,14 @@ jobs: poetry install - name: Build and publish env: - PYPI_USERNAME: __token__ - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - ./scripts/publish + POETRY_HTTP_BASIC_PYPI_USERNAME: __token__ + POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: poetry publish --build ``` -Notice that we are using poetry, and we are calling a bash script in `./scripts/publish`. You should configure the action, and publish with your tools (twine, poetry, etc.). Check [Commitizen example](https://github.com/commitizen-tools/commitizen/blob/master/scripts/publish) +Notice that we are using poetry to publish the package. + + You can also use [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) to publish your package. Push the changes and that's it. diff --git a/docs/tutorials/writing_commits.md b/docs/tutorials/writing_commits.md index a56d6494d..a3cf778dc 100644 --- a/docs/tutorials/writing_commits.md +++ b/docs/tutorials/writing_commits.md @@ -46,6 +46,6 @@ Emojis may be added as well (e.g., see [cz-emoji][cz_emoji]), which requires the [customization]: ../customization/config_file.md [conventional_commits]: https://www.conventionalcommits.org -[cz_emoji]: https://commitizen-tools.github.io/commitizen/third-party-commitizen/#cz-emoji +[cz_emoji]: https://commitizen-tools.github.io/commitizen/third-party-plugins/cz-emoji/ [configuration]: ../config/commit.md#encoding [breaking-change-config]: ../config/commit.md#breaking_change_exclamation_in_title