From 1250eba493466daabe3e9aa092ecca3dab5f275d Mon Sep 17 00:00:00 2001 From: Tim Hsiung Date: Wed, 4 Feb 2026 11:44:05 +0800 Subject: [PATCH 1/8] test(init): cover cz without descriptions (#1829) --- commitizen/commands/init.py | 15 +++++++++++---- tests/commands/test_init_command.py | 29 +++++++++++++---------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/commitizen/commands/init.py b/commitizen/commands/init.py index b0df9381d..d0f4b686a 100644 --- a/commitizen/commands/init.py +++ b/commitizen/commands/init.py @@ -171,24 +171,31 @@ def _ask_config_path(self) -> Path: def _ask_name(self) -> str: name: str = questionary.select( f"Please choose a cz (commit rule): (default: {DEFAULT_SETTINGS['name']})", - choices=self._construct_name_choice_with_description(), + choices=self._construct_name_choices_from_registry(), default=DEFAULT_SETTINGS["name"], style=self.cz.style, ).unsafe_ask() return name - def _construct_name_choice_with_description(self) -> list[questionary.Choice]: + def _construct_name_choices_from_registry(self) -> list[questionary.Choice]: + """ + Construct questionary choices of cz names from registry. + """ choices = [] for cz_name, cz_class in registry.items(): try: cz_obj = cz_class(self.config) except MissingCzCustomizeConfigError: + # Fallback if description is not available choices.append(questionary.Choice(title=cz_name, value=cz_name)) continue - first_example = cz_obj.schema().partition("\n")[0] + + # Get the first line of the schema as the description + # TODO(bearomorphism): schema is a workaround. Add a description method to the cz class. + description = cz_obj.schema().partition("\n")[0] choices.append( questionary.Choice( - title=cz_name, value=cz_name, description=first_example + title=cz_name, value=cz_name, description=description ) ) return choices diff --git a/tests/commands/test_init_command.py b/tests/commands/test_init_command.py index ad4431bfd..8675f7f9f 100644 --- a/tests/commands/test_init_command.py +++ b/tests/commands/test_init_command.py @@ -9,7 +9,6 @@ from commitizen import cmd, commands from commitizen.__version__ import __version__ -from commitizen.cz import registry from commitizen.exceptions import InitFailedError, NoAnswersError if TYPE_CHECKING: @@ -465,20 +464,18 @@ def test_init_configuration_with_version_provider( ) # Version should not be set when using version_provider -def test_construct_name_choice_with_description( - config: BaseConfig, mocker: MockFixture -): +def test_construct_name_choice_from_registry(config: BaseConfig): """Test the construction of cz name choices with descriptions.""" - init = commands.Init(config) - # mock the registry to have only one cz for testing - mocker.patch.dict( - "commitizen.cz.registry", - {"cz_conventional_commits": registry["cz_conventional_commits"]}, - clear=True, + choices = commands.Init(config)._construct_name_choices_from_registry() + assert choices[0].title == "cz_conventional_commits" + assert choices[0].value == "cz_conventional_commits" + assert choices[0].description == "(): " + assert choices[1].title == "cz_customize" + assert choices[1].value == "cz_customize" + assert choices[1].description is None + assert choices[2].title == "cz_jira" + assert choices[2].value == "cz_jira" + assert ( + choices[2].description + == " # " ) - choices = init._construct_name_choice_with_description() - assert len(choices) == 1 - choice = choices[0] - assert choice.title == "cz_conventional_commits" - assert choice.value == "cz_conventional_commits" - assert choice.description == "(): " From f504b56817d4bfc2a4e0d740db311cbd4ba1a28e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Feb 2026 03:44:04 +0000 Subject: [PATCH 2/8] =?UTF-8?q?bump:=20version=204.13.2=20=E2=86=92=204.13?= =?UTF-8?q?.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 6 ++++++ commitizen/__version__.py | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b4a030fc..fed5bc709 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.2 # automatically updated by Commitizen + rev: v4.13.3 # automatically updated by Commitizen hooks: - id: commitizen - id: commitizen-branch diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ba2ed463..8659d787b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v4.13.3 (2026-02-04) + +### Refactor + +- **version_schemes**: shorten generate_prerelease (#1838) + ## v4.13.2 (2026-02-03) ### Refactor diff --git a/commitizen/__version__.py b/commitizen/__version__.py index 13398e442..fd447e0fb 100644 --- a/commitizen/__version__.py +++ b/commitizen/__version__.py @@ -1 +1 @@ -__version__ = "4.13.2" +__version__ = "4.13.3" diff --git a/pyproject.toml b/pyproject.toml index fd8c1dfc2..e174a2c38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "commitizen" -version = "4.13.2" +version = "4.13.3" description = "Python commitizen client tool" authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }] maintainers = [ diff --git a/uv.lock b/uv.lock index 885caecfd..872ddd00f 100644 --- a/uv.lock +++ b/uv.lock @@ -195,7 +195,7 @@ wheels = [ [[package]] name = "commitizen" -version = "4.13.2" +version = "4.13.3" source = { editable = "." } dependencies = [ { name = "argcomplete" }, From 0ff19baa7fc5f2b428856ee52cc396b0db2206da Mon Sep 17 00:00:00 2001 From: Tim Hsiung Date: Wed, 4 Feb 2026 11:44:19 +0800 Subject: [PATCH 3/8] test: remove duplicated chdir fixture (#1844) --- tests/providers/conftest.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 tests/providers/conftest.py diff --git a/tests/providers/conftest.py b/tests/providers/conftest.py deleted file mode 100644 index 41b7bd02f..000000000 --- a/tests/providers/conftest.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import annotations - -import os -from pathlib import Path -from typing import TYPE_CHECKING - -import pytest - -if TYPE_CHECKING: - from collections.abc import Iterator - - -@pytest.fixture -def chdir(tmp_path: Path) -> Iterator[Path]: - cwd = Path() - os.chdir(tmp_path) - yield tmp_path - os.chdir(cwd) From 6ee98681a06981502ac1c675143a55be76cbe7a9 Mon Sep 17 00:00:00 2001 From: Tim Hsiung Date: Wed, 4 Feb 2026 11:45:07 +0800 Subject: [PATCH 4/8] test: use pathlib utilities in tests (#1843) --- tests/commands/conftest.py | 18 +- tests/commands/test_bump_command.py | 53 +++--- tests/commands/test_changelog_command.py | 182 ++++++++++----------- tests/commands/test_commit_command.py | 2 +- tests/conftest.py | 5 - tests/test_bump_update_version_in_files.py | 8 +- tests/test_conf.py | 8 +- 7 files changed, 130 insertions(+), 146 deletions(-) diff --git a/tests/commands/conftest.py b/tests/commands/conftest.py index c7d590450..ad7e1bc76 100644 --- a/tests/commands/conftest.py +++ b/tests/commands/conftest.py @@ -1,21 +1,11 @@ -import os from pathlib import Path import pytest from pytest_mock import MockerFixture, MockType -from commitizen import defaults -from commitizen.config import BaseConfig from commitizen.config.json_config import JsonConfig -@pytest.fixture -def config() -> BaseConfig: - _config = BaseConfig() - _config.settings.update({"name": defaults.DEFAULT_SETTINGS["name"]}) - return _config - - @pytest.fixture def config_customize() -> JsonConfig: json_string = r"""{ @@ -46,13 +36,13 @@ def config_customize() -> JsonConfig: @pytest.fixture -def changelog_path() -> str: - return os.path.join(os.getcwd(), "CHANGELOG.md") +def changelog_path() -> Path: + return Path("CHANGELOG.md") @pytest.fixture -def config_path() -> str: - return os.path.join(os.getcwd(), "pyproject.toml") +def config_path() -> Path: + return Path("pyproject.toml") @pytest.fixture diff --git a/tests/commands/test_bump_command.py b/tests/commands/test_bump_command.py index d458e34d8..6b8d903d6 100644 --- a/tests/commands/test_bump_command.py +++ b/tests/commands/test_bump_command.py @@ -422,10 +422,10 @@ def test_bump_files_only(tmp_commitizen_project, util: UtilFixture): assert git.tag_exist("0.3.0") is False - with open(tmp_version_file, encoding="utf-8") as f: + with tmp_version_file.open(encoding="utf-8") as f: assert "0.3.0" in f.read() - with open(tmp_commitizen_cfg_file, encoding="utf-8") as f: + with tmp_commitizen_cfg_file.open(encoding="utf-8") as f: assert "0.3.0" in f.read() @@ -444,7 +444,7 @@ def test_bump_local_version(tmp_commitizen_project, util: UtilFixture): util.run_cli("bump", "--yes", "--local-version") assert git.tag_exist("4.5.1+0.2.0") is True - with open(tmp_version_file, encoding="utf-8") as f: + with tmp_version_file.open(encoding="utf-8") as f: assert "4.5.1+0.2.0" in f.read() @@ -504,7 +504,7 @@ def test_bump_with_changelog_arg(util: UtilFixture, changelog_path): util.run_cli("bump", "--yes", "--changelog") assert git.tag_exist("0.2.0") is True - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() assert out.startswith("#") assert "0.2.0" in out @@ -513,13 +513,13 @@ def test_bump_with_changelog_arg(util: UtilFixture, changelog_path): @pytest.mark.usefixtures("tmp_commitizen_project") def test_bump_with_changelog_config(util: UtilFixture, changelog_path, config_path): util.create_file_and_commit("feat(user): new file") - with open(config_path, "a", encoding="utf-8") as fp: + with config_path.open("a", encoding="utf-8") as fp: fp.write("update_changelog_on_bump = true\n") util.run_cli("bump", "--yes") assert git.tag_exist("0.2.0") is True - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() assert out.startswith("#") assert "0.2.0" in out @@ -557,7 +557,7 @@ def test_bump_with_changelog_to_stdout_arg( assert "this should appear in stdout" in out assert git.tag_exist("0.2.0") is True - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() assert out.startswith("#") assert "0.2.0" in out @@ -794,14 +794,13 @@ def test_bump_version_with_less_components_in_config( tmp_commitizen_project = tmp_commitizen_project_initial(version=initial_version) util.run_cli("bump", "--yes") - tag_exists = git.tag_exist(expected_version_after_bump) - assert tag_exists is True + assert git.tag_exist(expected_version_after_bump) is True for version_file in [ tmp_commitizen_project.join("__version__.py"), tmp_commitizen_project.join("pyproject.toml"), ]: - with open(version_file) as f: + with version_file.open() as f: assert expected_version_after_bump in f.read() @@ -914,7 +913,7 @@ def test_bump_command_prerelease_scheme_via_cli( assert git.tag_exist("0.2.0-a0") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0-a0" in f.read() # PRERELEASE BUMP CREATES VERSION WITHOUT PRERELEASE @@ -922,7 +921,7 @@ def test_bump_command_prerelease_scheme_via_cli( assert git.tag_exist("0.2.0") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0" in f.read() @@ -939,14 +938,14 @@ def test_bump_command_prerelease_scheme_via_config( assert git.tag_exist("0.2.0-a0") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0-a0" in f.read() util.run_cli("bump", "--prerelease", "alpha", "--yes") assert git.tag_exist("0.2.0-a1") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0-a1" in f.read() # PRERELEASE BUMP CREATES VERSION WITHOUT PRERELEASE @@ -954,7 +953,7 @@ def test_bump_command_prerelease_scheme_via_config( assert git.tag_exist("0.2.0") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0" in f.read() @@ -971,14 +970,14 @@ def test_bump_command_prerelease_scheme_check_old_tags( assert git.tag_exist("v0.2.0-a0") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0-a0" in f.read() util.run_cli("bump", "--prerelease", "alpha") assert git.tag_exist("v0.2.0-a1") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0-a1" in f.read() # PRERELEASE BUMP CREATES VERSION WITHOUT PRERELEASE @@ -986,7 +985,7 @@ def test_bump_command_prerelease_scheme_check_old_tags( assert git.tag_exist("v0.2.0") is True for version_file in [tmp_version_file, tmp_commitizen_cfg_file]: - with open(version_file) as f: + with version_file.open() as f: assert "0.2.0" in f.read() @@ -1229,7 +1228,7 @@ def test_bump_get_next_update_changelog_on_bump( util: UtilFixture, capsys: pytest.CaptureFixture, config_path: Path ): util.create_file_and_commit("feat: new file") - with open(config_path, "a", encoding="utf-8") as fp: + with config_path.open("a", encoding="utf-8") as fp: fp.write("update_changelog_on_bump = true\n") with pytest.raises(DryRunExit): @@ -1439,12 +1438,12 @@ def test_is_initial_tag(mocker: MockFixture, tmp_commitizen_project, util: UtilF def test_changelog_config_flag_merge_prerelease( mocker: MockFixture, util: UtilFixture, - changelog_path: str, - config_path: str, + changelog_path: Path, + config_path: Path, file_regression: FileRegressionFixture, test_input: str, ): - with open(config_path, "a") as f: + with config_path.open("a") as f: f.write("changelog_merge_prerelease = true\n") f.write("update_changelog_on_bump = true\n") f.write("annotated_tag = true\n") @@ -1459,7 +1458,7 @@ def test_changelog_config_flag_merge_prerelease( util.run_cli("bump", "--changelog") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -1470,12 +1469,12 @@ def test_changelog_config_flag_merge_prerelease( @pytest.mark.freeze_time("2025-01-01") def test_changelog_config_flag_merge_prerelease_only_prerelease_present( util: UtilFixture, - changelog_path: str, - config_path: str, + changelog_path: Path, + config_path: Path, file_regression: FileRegressionFixture, test_input: str, ): - with open(config_path, "a") as f: + with config_path.open("a") as f: f.write("changelog_merge_prerelease = true\n") f.write("update_changelog_on_bump = true\n") f.write("annotated_tag = true\n") @@ -1489,7 +1488,7 @@ def test_changelog_config_flag_merge_prerelease_only_prerelease_present( util.run_cli("bump", "--changelog") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") diff --git a/tests/commands/test_changelog_command.py b/tests/commands/test_changelog_command.py index dc9785214..c15ffeee9 100644 --- a/tests/commands/test_changelog_command.py +++ b/tests/commands/test_changelog_command.py @@ -145,7 +145,7 @@ def test_changelog_replacing_unreleased_using_incremental( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-08-14") def test_changelog_is_persisted_using_incremental( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): @@ -157,7 +157,7 @@ def test_changelog_is_persisted_using_incremental( util.run_cli("changelog") - with open(changelog_path, "a", encoding="utf-8") as f: + with changelog_path.open("a", encoding="utf-8") as f: f.write("\nnote: this should be persisted using increment\n") util.create_file_and_commit("fix: mama gotta work") @@ -166,7 +166,7 @@ def test_changelog_is_persisted_using_incremental( util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -174,11 +174,11 @@ def test_changelog_is_persisted_using_incremental( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_incremental_angular_sample( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(changelog_path, "w", encoding="utf-8") as f: + with changelog_path.open("w", encoding="utf-8") as f: f.write( "# [10.0.0-rc.3](https://github.com/angular/angular/compare/10.0.0-rc.2...10.0.0-rc.3) (2020-04-22)\n" "\n" @@ -197,7 +197,7 @@ def test_changelog_incremental_angular_sample( util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -230,11 +230,11 @@ def test_changelog_incremental_angular_sample( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_incremental_keep_a_changelog_sample( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(changelog_path, "w", encoding="utf-8") as f: + with changelog_path.open("w", encoding="utf-8") as f: f.write(KEEP_A_CHANGELOG) util.create_file_and_commit("irrelevant commit") util.create_tag("1.0.0") @@ -247,7 +247,7 @@ def test_changelog_incremental_keep_a_changelog_sample( util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -405,7 +405,7 @@ def test_changelog_with_non_linear_merges_commit_order( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_multiple_incremental_do_not_add_new_lines( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): @@ -419,7 +419,7 @@ def test_changelog_multiple_incremental_do_not_add_new_lines( util.create_file_and_commit(commit_message) util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -427,17 +427,17 @@ def test_changelog_multiple_incremental_do_not_add_new_lines( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_incremental_newline_separates_new_content_from_old( - changelog_path: str, + changelog_path: Path, util: UtilFixture, file_regression: FileRegressionFixture, ): """Test for https://github.com/commitizen-tools/commitizen/issues/509""" - with open(changelog_path, "w", encoding="utf-8") as f: + with changelog_path.open("w", encoding="utf-8") as f: f.write("Pre-existing content that should be kept\n") util.create_file_and_commit("feat: add more cat videos") util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -554,21 +554,21 @@ def test_breaking_change_content_v1_with_exclamation_mark_feat( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_config_flag_increment( - changelog_path: str, - config_path: str, + changelog_path: Path, + config_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write("changelog_incremental = true\n") - with open(changelog_path, "a", encoding="utf-8") as f: + with changelog_path.open("a", encoding="utf-8") as f: f.write("\nnote: this should be persisted using increment\n") util.create_file_and_commit("feat: add new output") util.run_cli("changelog") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() assert "this should be persisted using increment" in out @@ -579,13 +579,13 @@ def test_changelog_config_flag_increment( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2025-12-29") def test_changelog_config_flag_merge_prerelease( - changelog_path: str, - config_path: str, + changelog_path: Path, + config_path: Path, file_regression: FileRegressionFixture, test_input: str, util: UtilFixture, ): - with open(config_path, "a") as f: + with config_path.open("a") as f: f.write("changelog_merge_prerelease = true\n") util.create_file_and_commit("irrelevant commit") @@ -602,7 +602,7 @@ def test_changelog_config_flag_merge_prerelease( util.run_cli("changelog") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -611,7 +611,7 @@ def test_changelog_config_flag_merge_prerelease( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_config_start_rev_option( capsys: pytest.CaptureFixture, - config_path: str, + config_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): @@ -623,7 +623,7 @@ def test_changelog_config_start_rev_option( util.create_file_and_commit("feat: after 0.2.0") util.create_file_and_commit("feat: after 0.2") - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('changelog_start_rev = "0.2.0"\n') with pytest.raises(DryRunExit): @@ -635,12 +635,12 @@ def test_changelog_config_start_rev_option( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_incremental_keep_a_changelog_sample_with_annotated_tag( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): """Fix #378""" - with open(changelog_path, "w", encoding="utf-8") as f: + with changelog_path.open("w", encoding="utf-8") as f: f.write(KEEP_A_CHANGELOG) util.create_file_and_commit("irrelevant commit") util.create_tag("1.0.0", annotated=True) @@ -653,7 +653,7 @@ def test_changelog_incremental_keep_a_changelog_sample_with_annotated_tag( util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -663,13 +663,13 @@ def test_changelog_incremental_keep_a_changelog_sample_with_annotated_tag( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2021-06-11") def test_changelog_incremental_with_release_candidate_version( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, test_input: str, util: UtilFixture, ): """Fix #357""" - with open(changelog_path, "w", encoding="utf-8") as f: + with changelog_path.open("w", encoding="utf-8") as f: f.write(KEEP_A_CHANGELOG) util.create_file_and_commit("irrelevant commit") util.create_tag("1.0.0", annotated=True) @@ -685,7 +685,7 @@ def test_changelog_incremental_with_release_candidate_version( util.run_cli("changelog", "--incremental") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -697,13 +697,13 @@ def test_changelog_incremental_with_release_candidate_version( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2021-06-11") def test_changelog_incremental_with_prerelease_version_to_prerelease_version( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, from_pre: str, to_pre: str, util: UtilFixture, ): - with open(changelog_path, "w") as f: + with changelog_path.open("w") as f: f.write(KEEP_A_CHANGELOG) util.create_file_and_commit("irrelevant commit") util.create_tag("1.0.0", annotated=True) @@ -715,7 +715,7 @@ def test_changelog_incremental_with_prerelease_version_to_prerelease_version( util.run_cli("bump", "--changelog", "--prerelease", to_pre, "--yes") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -725,13 +725,13 @@ def test_changelog_incremental_with_prerelease_version_to_prerelease_version( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2025-12-29") def test_changelog_release_candidate_version_with_merge_prerelease( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, test_input: str, util: UtilFixture, ): """Fix #357""" - with open(changelog_path, "w") as f: + with changelog_path.open("w") as f: f.write(KEEP_A_CHANGELOG) util.create_file_and_commit("irrelevant commit") util.create_tag("1.0.0") @@ -747,7 +747,7 @@ def test_changelog_release_candidate_version_with_merge_prerelease( util.run_cli("changelog", "--merge-prerelease") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -757,13 +757,13 @@ def test_changelog_release_candidate_version_with_merge_prerelease( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2023-04-16") def test_changelog_incremental_with_merge_prerelease( - changelog_path: str, + changelog_path: Path, file_regression: FileRegressionFixture, test_input: str, util: UtilFixture, ): """Fix #357""" - with open(changelog_path, "w") as f: + with changelog_path.open("w") as f: f.write(KEEP_A_CHANGELOG) util.create_file_and_commit("irrelevant commit") util.create_tag("1.0.0") @@ -782,15 +782,15 @@ def test_changelog_incremental_with_merge_prerelease( util.run_cli("changelog", "--merge-prerelease", "--incremental") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @pytest.mark.usefixtures("tmp_commitizen_project") -def test_changelog_with_filename_as_empty_string(config_path: str, util: UtilFixture): - with open(config_path, "a", encoding="utf-8") as f: +def test_changelog_with_filename_as_empty_string(config_path: Path, util: UtilFixture): + with config_path.open("a", encoding="utf-8") as f: f.write("changelog_file = true\n") util.create_file_and_commit("feat: add new output") @@ -802,12 +802,12 @@ def test_changelog_with_filename_as_empty_string(config_path: str, util: UtilFix @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-02-13") def test_changelog_from_rev_first_version_from_arg( - config_path: str, - changelog_path: str, + config_path: Path, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -820,7 +820,7 @@ def test_changelog_from_rev_first_version_from_arg( util.run_cli("bump", "--yes") util.run_cli("changelog", "0.2.0") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -829,12 +829,12 @@ def test_changelog_from_rev_first_version_from_arg( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-02-13") def test_changelog_from_rev_latest_version_from_arg( - config_path: str, - changelog_path: str, + config_path: Path, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -848,7 +848,7 @@ def test_changelog_from_rev_latest_version_from_arg( util.run_cli("changelog", "0.3.0") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -865,10 +865,10 @@ def test_changelog_from_rev_latest_version_from_arg( ), ) def test_changelog_from_rev_range_not_found( - config_path: str, rev_range: str, tag: str, util: UtilFixture + config_path: Path, rev_range: str, tag: str, util: UtilFixture ): """Provides an invalid revision ID to changelog command""" - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -885,9 +885,9 @@ def test_changelog_from_rev_range_not_found( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_multiple_matching_tags( - config_path: str, changelog_path: str, util: UtilFixture + config_path: Path, changelog_path: Path, util: UtilFixture ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "new-$version"\nlegacy_tag_formats = ["legacy-$version"]') util.create_file_and_commit("feat: new file") @@ -903,7 +903,7 @@ def test_changelog_multiple_matching_tags( warning = warnings[0] assert "Multiple tags found for version 2.0.0" in str(warning.message) - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() # Ensure only one tag is rendered @@ -912,7 +912,7 @@ def test_changelog_multiple_matching_tags( @pytest.mark.usefixtures("tmp_commitizen_project") def test_changelog_from_rev_range_default_tag_format( - changelog_path: str, util: UtilFixture + changelog_path: Path, util: UtilFixture ): """Checks that rev_range is calculated with the default (None) tag format""" # create commit and tag @@ -926,7 +926,7 @@ def test_changelog_from_rev_range_default_tag_format( util.run_cli("changelog", "0.3.0") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() assert "new file" not in out @@ -935,12 +935,12 @@ def test_changelog_from_rev_range_default_tag_format( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-02-13") def test_changelog_from_rev_version_range_including_first_tag( - config_path: str, - changelog_path: str, + config_path: Path, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -953,7 +953,7 @@ def test_changelog_from_rev_version_range_including_first_tag( util.run_cli("bump", "--yes") util.run_cli("changelog", "0.2.0..0.3.0") - with open(changelog_path, encoding="utf-8") as f: + with changelog_path.open(encoding="utf-8") as f: out = f.read() file_regression.check(out, extension=".md") @@ -962,12 +962,12 @@ def test_changelog_from_rev_version_range_including_first_tag( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-02-13") def test_changelog_from_rev_version_range_from_arg( - config_path: str, - changelog_path: str, + config_path: Path, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -983,7 +983,7 @@ def test_changelog_from_rev_version_range_from_arg( util.run_cli("bump", "--yes") util.run_cli("changelog", "0.3.0..0.4.0") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -992,8 +992,8 @@ def test_changelog_from_rev_version_range_from_arg( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-02-13") def test_changelog_from_rev_version_range_with_legacy_tags( - config_path: str, - changelog_path: str, + config_path: Path, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): @@ -1027,7 +1027,7 @@ def test_changelog_from_rev_version_range_with_legacy_tags( def test_changelog_from_rev_version_with_big_range_from_arg( config_path, changelog_path, file_regression, util: UtilFixture ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -1053,7 +1053,7 @@ def test_changelog_from_rev_version_with_big_range_from_arg( util.run_cli("bump", "--yes") # 0.6.0 util.run_cli("changelog", "0.3.0..0.5.0") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -1063,11 +1063,11 @@ def test_changelog_from_rev_version_with_big_range_from_arg( @pytest.mark.freeze_time("2022-02-13") def test_changelog_from_rev_latest_version_dry_run( capsys: pytest.CaptureFixture, - config_path: str, + config_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a") as f: + with config_path.open("a") as f: f.write('tag_format = "$version"\n') # create commit and tag @@ -1111,12 +1111,12 @@ def test_invalid_subject_is_skipped( @pytest.mark.usefixtures("tmp_commitizen_project") @pytest.mark.freeze_time("2022-02-13") def test_changelog_with_customized_change_type_order( - config_path: str, - changelog_path: str, + config_path: Path, + changelog_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a") as f: + with config_path.open("a") as f: f.write('tag_format = "$version"\n') f.write( 'change_type_order = ["BREAKING CHANGE", "Perf", "Fix", "Feat", "Refactor"]\n' @@ -1137,7 +1137,7 @@ def test_changelog_with_customized_change_type_order( util.run_cli("bump", "--yes") util.run_cli("changelog", "0.3.0..0.4.0") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() file_regression.check(out, extension=".md") @@ -1157,11 +1157,11 @@ def test_empty_commit_list(mocker: MockFixture, util: UtilFixture): @pytest.mark.freeze_time("2022-02-13") def test_changelog_prerelease_rev_with_use_scheme_semver( capsys: pytest.CaptureFixture, - config_path: str, + config_path: Path, file_regression: FileRegressionFixture, util: UtilFixture, ): - with open(config_path, "a") as f: + with config_path.open("a") as f: f.write('tag_format = "$version"\nversion_scheme = "semver"') # create commit and tag @@ -1356,7 +1356,7 @@ def test_changelog_only_tag_matching_tag_format_included_prefix( config_path: Path, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('\ntag_format = "custom${version}"\n') util.create_file_and_commit("feat: new file") util.create_tag("v0.2.0") @@ -1366,7 +1366,7 @@ def test_changelog_only_tag_matching_tag_format_included_prefix( util.run_cli("bump", "--changelog", "--yes") util.create_file_and_commit("feat: another new file") util.run_cli("bump", "--changelog", "--yes") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() assert out.startswith("## custom0.3.0 (2021-06-11)") assert "## v0.2.0 (2021-06-11)" not in out @@ -1379,7 +1379,7 @@ def test_changelog_only_tag_matching_tag_format_included_prefix_sep( config_path: Path, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('\ntag_format = "custom-${version}"\n') util.create_file_and_commit("feat: new file") util.create_tag("v0.2.0") @@ -1387,12 +1387,12 @@ def test_changelog_only_tag_matching_tag_format_included_prefix_sep( util.create_tag("0.2.0") util.create_tag("random0.2.0") util.run_cli("bump", "--changelog", "--yes") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() util.create_file_and_commit("feat: new version another new file") util.create_file_and_commit("feat: new version some new file") util.run_cli("bump", "--changelog") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() assert out.startswith("## custom-0.3.0") assert "## v0.2.0" not in out @@ -1406,7 +1406,7 @@ def test_changelog_only_tag_matching_tag_format_included_suffix( config_path: Path, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('\ntag_format = "${version}custom"\n') util.create_file_and_commit("feat: new file") util.create_tag("v0.2.0") @@ -1419,7 +1419,7 @@ def test_changelog_only_tag_matching_tag_format_included_suffix( util.create_file_and_commit("feat: another new file") # bump to 0.3.0custom util.run_cli("bump", "--changelog", "--yes") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() assert out.startswith("## 0.3.0custom (2021-06-11)") assert "## v0.2.0 (2021-06-11)" not in out @@ -1433,7 +1433,7 @@ def test_changelog_only_tag_matching_tag_format_included_suffix_sep( config_path: Path, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.write('\ntag_format = "${version}-custom"\n') util.create_file_and_commit("feat: new file") util.create_tag("v0.2.0") @@ -1443,7 +1443,7 @@ def test_changelog_only_tag_matching_tag_format_included_suffix_sep( util.run_cli("bump", "--changelog", "--yes") util.create_file_and_commit("feat: another new file") util.run_cli("bump", "--changelog", "--yes") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() assert out.startswith("## 0.3.0-custom (2021-06-11)") assert "## v0.2.0 (2021-06-11)" not in out @@ -1456,7 +1456,7 @@ def test_changelog_legacy_tags( config_path: Path, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.writelines( [ 'tag_format = "v${version}"\n', @@ -1475,7 +1475,7 @@ def test_changelog_legacy_tags( util.create_file_and_commit("feat: another new file") util.create_tag("not-0.3.1") util.run_cli("bump", "--changelog", "--yes") - out = open(changelog_path).read() + out = changelog_path.open().read() assert "## v0.3.0" in out assert "## older-0.2.0" in out assert "## oldest-0.1.0" in out @@ -1520,7 +1520,7 @@ def test_changelog_incremental_change_tag_format( util.create_file_and_commit("feat: another new file") util.create_tag("v0.3.0") util.run_cli("changelog", "--incremental") - out = open(changelog_path).read() + out = changelog_path.open().read() assert "## v0.3.0" in out assert "## older-0.2.0" in out assert "## older-0.1.0" in out @@ -1534,7 +1534,7 @@ def test_changelog_ignored_tags( capsys: pytest.CaptureFixture, util: UtilFixture, ): - with open(config_path, "a", encoding="utf-8") as f: + with config_path.open("a", encoding="utf-8") as f: f.writelines( [ 'tag_format = "v${version}"\n', @@ -1553,7 +1553,7 @@ def test_changelog_ignored_tags( util.create_file_and_commit("feat: another new file") util.create_tag("not-ignored") util.run_cli("bump", "--changelog", "--yes") - with open(changelog_path) as f: + with changelog_path.open() as f: out = f.read() assert "## ignore-0.1.0" not in out assert "## ignored" not in out diff --git a/tests/commands/test_commit_command.py b/tests/commands/test_commit_command.py index c80a13823..b3b379115 100644 --- a/tests/commands/test_commit_command.py +++ b/tests/commands/test_commit_command.py @@ -50,7 +50,7 @@ def staging_is_clean(mocker: MockFixture, tmp_git_project): @pytest.fixture def backup_file(tmp_git_project): - with open(get_backup_file_path(), "w") as backup_file: + with get_backup_file_path().open("w") as backup_file: backup_file.write("backup commit") diff --git a/tests/conftest.py b/tests/conftest.py index b1690ccab..06f1a30c9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -165,11 +165,6 @@ def config(): return _config -@pytest.fixture -def config_path() -> str: - return os.path.join(os.getcwd(), "pyproject.toml") - - class SemverCommitizen(BaseCommitizen): """A minimal cz rules used to test changelog and bump. diff --git a/tests/test_bump_update_version_in_files.py b/tests/test_bump_update_version_in_files.py index 8fd4c465b..1a1afade0 100644 --- a/tests/test_bump_update_version_in_files.py +++ b/tests/test_bump_update_version_in_files.py @@ -125,7 +125,7 @@ def test_partial_update_of_file(version_repeated_file, file_regression): bump.update_version_in_files( old_version, new_version, [location], check_consistency=False, encoding="utf-8" ) - with open(version_repeated_file, encoding="utf-8") as f: + with version_repeated_file.open(encoding="utf-8") as f: file_regression.check(f.read(), extension=".json") @@ -137,7 +137,7 @@ def test_random_location(random_location_version_file, file_regression): bump.update_version_in_files( old_version, new_version, [location], check_consistency=False, encoding="utf-8" ) - with open(random_location_version_file, encoding="utf-8") as f: + with random_location_version_file.open(encoding="utf-8") as f: file_regression.check(f.read(), extension=".lock") @@ -151,7 +151,7 @@ def test_duplicates_are_change_with_no_regex( bump.update_version_in_files( old_version, new_version, [location], check_consistency=False, encoding="utf-8" ) - with open(random_location_version_file, encoding="utf-8") as f: + with random_location_version_file.open(encoding="utf-8") as f: file_regression.check(f.read(), extension=".lock") @@ -220,7 +220,7 @@ def test_multiple_versions_to_bump( bump.update_version_in_files( old_version, new_version, [location], check_consistency=False, encoding="utf-8" ) - with open(multiple_versions_to_update_poetry_lock, encoding="utf-8") as f: + with multiple_versions_to_update_poetry_lock.open(encoding="utf-8") as f: file_regression.check(f.read(), extension=".toml") diff --git a/tests/test_conf.py b/tests/test_conf.py index f1ff76ff8..923535e0c 100644 --- a/tests/test_conf.py +++ b/tests/test_conf.py @@ -391,7 +391,7 @@ def test_init_empty_config_content(self, tmpdir, config_file): toml_config = TomlConfig(data="", path=path) toml_config.init_empty_config_content() - with open(path, encoding="utf-8") as toml_file: + with path.open(encoding="utf-8") as toml_file: assert toml_file.read() == "[tool.commitizen]\n" def test_init_empty_config_content_with_existing_content(self, tmpdir, config_file): @@ -402,7 +402,7 @@ def test_init_empty_config_content_with_existing_content(self, tmpdir, config_fi toml_config = TomlConfig(data="", path=path) toml_config.init_empty_config_content() - with open(path, encoding="utf-8") as toml_file: + with path.open(encoding="utf-8") as toml_file: assert toml_file.read() == existing_content + "\n[tool.commitizen]\n" def test_init_with_invalid_config_content(self, tmpdir, config_file): @@ -427,7 +427,7 @@ def test_init_empty_config_content(self, tmpdir, config_file): json_config = JsonConfig(data="{}", path=path) json_config.init_empty_config_content() - with open(path, encoding="utf-8") as json_file: + with path.open(encoding="utf-8") as json_file: assert json.load(json_file) == {"commitizen": {}} def test_init_with_invalid_config_content(self, tmpdir, config_file): @@ -452,7 +452,7 @@ def test_init_empty_config_content(self, tmpdir, config_file): yaml_config = YAMLConfig(data="{}", path=path) yaml_config.init_empty_config_content() - with open(path) as yaml_file: + with path.open() as yaml_file: assert yaml.safe_load(yaml_file) == {"commitizen": {}} def test_init_with_invalid_content(self, tmpdir, config_file): From 14a4f0b8a427c7d061eb134521441ef6b8ddde00 Mon Sep 17 00:00:00 2001 From: Tim Hsiung Date: Wed, 4 Feb 2026 11:45:17 +0800 Subject: [PATCH 5/8] ci(gen_cli_help_screenshots): refactor the script and add some TODOs (#1845) --- docs/images/cli_help/cz___help.svg | 166 ++++---- docs/images/cli_help/cz_bump___help.svg | 380 +++++++++---------- docs/images/cli_help/cz_changelog___help.svg | 198 +++++----- docs/images/cli_help/cz_check___help.svg | 150 ++++---- docs/images/cli_help/cz_commit___help.svg | 122 +++--- docs/images/cli_help/cz_example___help.svg | 44 +-- docs/images/cli_help/cz_info___help.svg | 44 +-- docs/images/cli_help/cz_init___help.svg | 44 +-- docs/images/cli_help/cz_ls___help.svg | 44 +-- docs/images/cli_help/cz_schema___help.svg | 44 +-- docs/images/cli_help/cz_version___help.svg | 92 ++--- scripts/gen_cli_help_screenshots.py | 44 ++- 12 files changed, 681 insertions(+), 691 deletions(-) diff --git a/docs/images/cli_help/cz___help.svg b/docs/images/cli_help/cz___help.svg index 64b79fc0b..fcaf6ef5b 100644 --- a/docs/images/cli_help/cz___help.svg +++ b/docs/images/cli_help/cz___help.svg @@ -19,136 +19,136 @@ font-weight: 700; } - .terminal-199999382-matrix { + .terminal-607367767-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-199999382-title { + .terminal-607367767-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-199999382-r1 { fill: #c5c8c6 } -.terminal-199999382-r2 { fill: #c5c8c6;font-weight: bold } -.terminal-199999382-r3 { fill: #d0b344 } -.terminal-199999382-r4 { fill: #1984e9;text-decoration: underline; } -.terminal-199999382-r5 { fill: #68a0b3;font-weight: bold } + .terminal-607367767-r1 { fill: #c5c8c6 } +.terminal-607367767-r2 { fill: #c5c8c6;font-weight: bold } +.terminal-607367767-r3 { fill: #d0b344 } +.terminal-607367767-r4 { fill: #1984e9;text-decoration: underline; } +.terminal-607367767-r5 { fill: #68a0b3;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -160,46 +160,46 @@ - + - - $ cz --help -usage: cz [-h][--config CONFIG][--debug][-n NAME][-nr NO_RAISE] -{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} -... - -Commitizen is a powerful release management tool that helps teams maintain  -consistent and meaningful commit messages while automating version management. -For more information, please visit https://commitizen-tools.github.io/commitizen - -options: -  -h, --help            show this help message and exit -  --config CONFIG       The path to the configuration file. -  --debug               Use debug mode. -  -n NAME, --name NAME  Use the given commitizen (default: -                        cz_conventional_commits). -  -nr NO_RAISE, --no-raise NO_RAISE -                        Comma-separated error codes that won't raise error, -                        e.g., cz -nr 1,2,3 bump. See codes at -https://commitizen- -                        tools.github.io/commitizen/exit_codes/ - -commands: -{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} -    init                Initialize commitizen configuration. -    commit (c)          Create new commit. -    ls                  Show available Commitizens. -    example             Show commit example. -    info                Show information about the cz. -    schema              Show commit schema. -    bump                Bump semantic version based on the git log. -    changelog (ch)      Generate changelog (note that it will overwrite -                        existing files). -    check               Validate that a commit message matches the commitizen -                        schema. -    version             Get the version of the installed commitizen or the -                        current project (default: installed commitizen). - + + $ cz --help +usage: cz [-h][--config CONFIG][--debug][-n NAME][-nr NO_RAISE] +{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} +... + +Commitizen is a powerful release management tool that helps teams maintain  +consistent and meaningful commit messages while automating version management. +For more information, please visit https://commitizen-tools.github.io/commitizen + +options: +  -h, --help            show this help message and exit +  --config CONFIG       The path to the configuration file. +  --debug               Use debug mode. +  -n, --name NAME       Use the given commitizen (default: +                        cz_conventional_commits). +  -nr, --no-raise NO_RAISE +                        Comma-separated error codes that won't raise error, +                        e.g., cz -nr 1,2,3 bump. See codes at +https://commitizen- +                        tools.github.io/commitizen/exit_codes/ + +commands: +{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} +    init                Initialize commitizen configuration. +    commit (c)          Create new commit. +    ls                  Show available Commitizens. +    example             Show commit example. +    info                Show information about the cz. +    schema              Show commit schema. +    bump                Bump semantic version based on the git log. +    changelog (ch)      Generate changelog (note that it will overwrite +                        existing files). +    check               Validate that a commit message matches the commitizen +                        schema. +    version             Get the version of the installed commitizen or the +                        current project (default: installed commitizen). + diff --git a/docs/images/cli_help/cz_bump___help.svg b/docs/images/cli_help/cz_bump___help.svg index ec6b4816f..e29b71cd8 100644 --- a/docs/images/cli_help/cz_bump___help.svg +++ b/docs/images/cli_help/cz_bump___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - - $ cz bump --help -usage: cz bump [-h][--dry-run][--files-only][--version-files-only] -[--local-version][--changelog][--no-verify][--yes] -[--tag-format TAG_FORMAT][--bump-message BUMP_MESSAGE] -[--prerelease {alpha,beta,rc}][--devrelease DEVRELEASE] -[--increment {MAJOR,MINOR,PATCH}] -[--increment-mode {linear,exact}][--check-consistency] -[--annotated-tag] -[--annotated-tag-message ANNOTATED_TAG_MESSAGE][--gpg-sign] -[--changelog-to-stdout][--git-output-to-stderr][--retry] -[--major-version-zero][--template TEMPLATE][--extra EXTRA] -[--file-name FILE_NAME][--prerelease-offset PRERELEASE_OFFSET] -[--version-scheme {pep440,semver,semver2}] -[--version-type {pep440,semver,semver2}] -[--build-metadata BUILD_METADATA][--get-next] -[--allow-no-commit] -[MANUAL_VERSION] - -Bump semantic version based on the git log - -positional arguments: -  MANUAL_VERSION        Bump to the given version (e.g., 1.5.3). - -options: -  -h, --help            show this help message and exit -  --dry-run             Perform a dry run, without committing or modifying -                        files. -  --files-only          Bump version in the `version_files` specified in the -                        configuration file only(deprecated; use --version- -                        files-only instead). -  --version-files-only  Bump version in the files from the config -  --local-version       Bump version only the local version portion (ignoring -                        the public version). -  --changelog, -ch      Generate the changelog for the latest version. -  --no-verify           Bypass the pre-commit and commit-msg hooks. -  --yes                 Accept automatically answered questions. -  --tag-format TAG_FORMAT -                        The format used to tag the commit and read it. Use it -                        in existing projects, and wrap around simple quotes. -  --bump-message BUMP_MESSAGE -                        Template used to create the release commit, useful -                        when working with CI. -  --prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} -                        Type of prerelease. -  --devrelease DEVRELEASE, -d DEVRELEASE -                        Specify non-negative integer for dev release. -  --increment {MAJOR,MINOR,PATCH} -                        Specify the desired increment. -  --increment-mode {linear,exact} -                        Set the method by which the new version is chosen. -'linear'(default) resolves the next version based on -                        typical linear version progression, where bumping of a -                        pre-release with lower precedence than the current -                        pre-release phase maintains the current phase of -                        higher precedence. 'exact' applies the changes that -                        have been specified (or determined from the commit -                        log) without interpretation, ensuring the increment -                        and pre-release are always honored. -  --check-consistency, -cc -                        Check consistency among versions defined in Commitizen -                        configuration file and `version_files`. -  --annotated-tag, -at  Create annotated tag instead of lightweight one. -  --annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE -                        Create annotated tag message. -  --gpg-sign, -s        Sign tag instead of lightweight one. -  --changelog-to-stdout -                        Output changelog to stdout. -  --git-output-to-stderr -                        Redirect git output to stderr. -  --retry               Retry commit if it fails for the first time. -  --major-version-zero  Keep major version at zero, even for breaking changes. -  --template TEMPLATE, -t TEMPLATE -                        Changelog template file name (relative to the current -                        working directory). -  --extra EXTRA, -e EXTRA -                        Changelog extra variables (in the form 'key=value'). -  --file-name FILE_NAME -                        File name of changelog (default: 'CHANGELOG.md'). -  --prerelease-offset PRERELEASE_OFFSET -                        Start pre-releases with this offset. -  --version-scheme {pep440,semver,semver2} -                        Choose version scheme. -  --version-type {pep440,semver,semver2} -                        Deprecated, use `--version-scheme` instead. -  --build-metadata BUILD_METADATA -                        Add additional build-metadata to the version-number. -  --get-next            Determine the next version and write to stdout. -  --allow-no-commit     Bump version without eligible commits. - + + $ cz bump --help +usage: cz bump [-h][--dry-run][--files-only][--version-files-only] +[--local-version][--changelog][--no-verify][--yes] +[--tag-format TAG_FORMAT][--bump-message BUMP_MESSAGE] +[--prerelease {alpha,beta,rc}][--devrelease DEVRELEASE] +[--increment {MAJOR,MINOR,PATCH}] +[--increment-mode {linear,exact}][--check-consistency] +[--annotated-tag] +[--annotated-tag-message ANNOTATED_TAG_MESSAGE][--gpg-sign] +[--changelog-to-stdout][--git-output-to-stderr][--retry] +[--major-version-zero][--template TEMPLATE][--extra EXTRA] +[--file-name FILE_NAME][--prerelease-offset PRERELEASE_OFFSET] +[--version-scheme {pep440,semver,semver2}] +[--version-type {pep440,semver,semver2}] +[--build-metadata BUILD_METADATA][--get-next] +[--allow-no-commit] +[MANUAL_VERSION] + +Bump semantic version based on the git log + +positional arguments: +  MANUAL_VERSION        Bump to the given version (e.g., 1.5.3). + +options: +  -h, --help            show this help message and exit +  --dry-run             Perform a dry run, without committing or modifying +                        files. +  --files-only          Bump version in the `version_files` specified in the +                        configuration file only(deprecated; use --version- +                        files-only instead). +  --version-files-only  Bump version in the files from the config +  --local-version       Bump version only the local version portion (ignoring +                        the public version). +  --changelog, -ch      Generate the changelog for the latest version. +  --no-verify           Bypass the pre-commit and commit-msg hooks. +  --yes                 Accept automatically answered questions. +  --tag-format TAG_FORMAT +                        The format used to tag the commit and read it. Use it +                        in existing projects, and wrap around simple quotes. +  --bump-message BUMP_MESSAGE +                        Template used to create the release commit, useful +                        when working with CI. +  --prerelease, -pr {alpha,beta,rc} +                        Type of prerelease. +  --devrelease, -d DEVRELEASE +                        Specify non-negative integer for dev release. +  --increment {MAJOR,MINOR,PATCH} +                        Specify the desired increment. +  --increment-mode {linear,exact} +                        Set the method by which the new version is chosen. +'linear'(default) resolves the next version based on +                        typical linear version progression, where bumping of a +                        pre-release with lower precedence than the current +                        pre-release phase maintains the current phase of +                        higher precedence. 'exact' applies the changes that +                        have been specified (or determined from the commit +                        log) without interpretation, ensuring the increment +                        and pre-release are always honored. +  --check-consistency, -cc +                        Check consistency among versions defined in Commitizen +                        configuration file and `version_files`. +  --annotated-tag, -at  Create annotated tag instead of lightweight one. +  --annotated-tag-message, -atm ANNOTATED_TAG_MESSAGE +                        Create annotated tag message. +  --gpg-sign, -s        Sign tag instead of lightweight one. +  --changelog-to-stdout +                        Output changelog to stdout. +  --git-output-to-stderr +                        Redirect git output to stderr. +  --retry               Retry commit if it fails for the first time. +  --major-version-zero  Keep major version at zero, even for breaking changes. +  --template, -t TEMPLATE +                        Changelog template file name (relative to the current +                        working directory). +  --extra, -e EXTRA     Changelog extra variables (in the form 'key=value'). +  --file-name FILE_NAME +                        File name of changelog (default: 'CHANGELOG.md'). +  --prerelease-offset PRERELEASE_OFFSET +                        Start pre-releases with this offset. +  --version-scheme {pep440,semver,semver2} +                        Choose version scheme. +  --version-type {pep440,semver,semver2} +                        Deprecated, use `--version-scheme` instead. +  --build-metadata BUILD_METADATA +                        Add additional build-metadata to the version-number. +  --get-next            Determine the next version and write to stdout. +  --allow-no-commit     Bump version without eligible commits. + diff --git a/docs/images/cli_help/cz_changelog___help.svg b/docs/images/cli_help/cz_changelog___help.svg index b0d048cae..e02d9cd23 100644 --- a/docs/images/cli_help/cz_changelog___help.svg +++ b/docs/images/cli_help/cz_changelog___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - - $ cz changelog --help -usage: cz changelog [-h][--dry-run][--file-name FILE_NAME] -[--unreleased-version UNRELEASED_VERSION][--incremental] -[--start-rev START_REV][--merge-prerelease] -[--version-scheme {pep440,semver,semver2}] -[--export-template EXPORT_TEMPLATE][--template TEMPLATE] -[--extra EXTRA][--tag-format TAG_FORMAT] - - -Generate changelog (note that it will overwrite existing files) - -positional arguments: -  rev_range             Generate changelog for the given version (e.g., 1.5.3) -                        or version range (e.g., 1.5.3..1.7.9). - -options: -  -h, --help            show this help message and exit -  --dry-run             Show changelog to stdout. -  --file-name FILE_NAME -                        File name of changelog (default: 'CHANGELOG.md'). -  --unreleased-version UNRELEASED_VERSION -                        Set the value for the new version (use the tag value), -                        instead of using unreleased versions. -  --incremental         Generate changelog from the last created version, -                        useful if the changelog has been manually modified. -  --start-rev START_REV -                        Start rev of the changelog. If not set, it will -                        generate changelog from the beginning. -  --merge-prerelease    Collect all changes from prereleases into the next -                        non-prerelease. If not set, it will include -                        prereleases in the changelog. -  --version-scheme {pep440,semver,semver2} -                        Choose version scheme. -  --export-template EXPORT_TEMPLATE -                        Export the changelog template into this file instead -                        of rendering it. -  --template TEMPLATE, -t TEMPLATE -                        Changelog template file name (relative to the current -                        working directory). -  --extra EXTRA, -e EXTRA -                        Changelog extra variables (in the form 'key=value'). -  --tag-format TAG_FORMAT -                        The format of the tag, wrap around simple quotes. - + + $ cz changelog --help +usage: cz changelog [-h][--dry-run][--file-name FILE_NAME] +[--unreleased-version UNRELEASED_VERSION][--incremental] +[--start-rev START_REV][--merge-prerelease] +[--version-scheme {pep440,semver,semver2}] +[--export-template EXPORT_TEMPLATE][--template TEMPLATE] +[--extra EXTRA][--tag-format TAG_FORMAT] + + +Generate changelog (note that it will overwrite existing files) + +positional arguments: +  rev_range             Generate changelog for the given version (e.g., 1.5.3) +                        or version range (e.g., 1.5.3..1.7.9). + +options: +  -h, --help            show this help message and exit +  --dry-run             Show changelog to stdout. +  --file-name FILE_NAME +                        File name of changelog (default: 'CHANGELOG.md'). +  --unreleased-version UNRELEASED_VERSION +                        Set the value for the new version (use the tag value), +                        instead of using unreleased versions. +  --incremental         Generate changelog from the last created version, +                        useful if the changelog has been manually modified. +  --start-rev START_REV +                        Start rev of the changelog. If not set, it will +                        generate changelog from the beginning. +  --merge-prerelease    Collect all changes from prereleases into the next +                        non-prerelease. If not set, it will include +                        prereleases in the changelog. +  --version-scheme {pep440,semver,semver2} +                        Choose version scheme. +  --export-template EXPORT_TEMPLATE +                        Export the changelog template into this file instead +                        of rendering it. +  --template, -t TEMPLATE +                        Changelog template file name (relative to the current +                        working directory). +  --extra, -e EXTRA     Changelog extra variables (in the form 'key=value'). +  --tag-format TAG_FORMAT +                        The format of the tag, wrap around simple quotes. + diff --git a/docs/images/cli_help/cz_check___help.svg b/docs/images/cli_help/cz_check___help.svg index 1091491d3..8b17e03f1 100644 --- a/docs/images/cli_help/cz_check___help.svg +++ b/docs/images/cli_help/cz_check___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + - + - - $ cz check --help -usage: cz check [-h] -[--commit-msg-file COMMIT_MSG_FILE | --rev-range REV_RANGE | -d  -| -m MESSAGE] -[--allow-abort][--allowed-prefixes [ALLOWED_PREFIXES ...]] -[-l MESSAGE_LENGTH_LIMIT] - -Validate that a commit message matches the commitizen schema - -options: -  -h, --help            show this help message and exit -  --commit-msg-file COMMIT_MSG_FILE -                        Ask for the name of the temporary file that contains -                        the commit message. Use it in a git hook script: -MSG_FILE=$1. -  --rev-range REV_RANGE -                        Validate the commits in the given range of git rev, -                        e.g., master..HEAD. -  -d, --use-default-range -                        Validate the commits from the default branch to HEAD, -                        e.g., refs/remotes/origin/master..HEAD. -  -m MESSAGE, --message MESSAGE -                        Validate the given commit message. -  --allow-abort         Allow empty commit messages, which typically abort a -                        commit. -  --allowed-prefixes [ALLOWED_PREFIXES ...] -                        Skip validation for commit messages that start with -                        the specified prefixes. -  -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT -                        Restrict the length of the **first line** of the -                        commit message; 0 for no limit. - + + $ cz check --help +usage: cz check [-h][--commit-msg-file COMMIT_MSG_FILE | +                --rev-range REV_RANGE | -d | -m MESSAGE][--allow-abort] +[--allowed-prefixes [ALLOWED_PREFIXES ...]] +[-l MESSAGE_LENGTH_LIMIT] + +Validate that a commit message matches the commitizen schema + +options: +  -h, --help            show this help message and exit +  --commit-msg-file COMMIT_MSG_FILE +                        Ask for the name of the temporary file that contains +                        the commit message. Use it in a git hook script: +MSG_FILE=$1. +  --rev-range REV_RANGE +                        Validate the commits in the given range of git rev, +                        e.g., master..HEAD. +  -d, --use-default-range +                        Validate the commits from the default branch to HEAD, +                        e.g., refs/remotes/origin/master..HEAD. +  -m, --message MESSAGE +                        Validate the given commit message. +  --allow-abort         Allow empty commit messages, which typically abort a +                        commit. +  --allowed-prefixes [ALLOWED_PREFIXES ...] +                        Skip validation for commit messages that start with +                        the specified prefixes. +  -l, --message-length-limit MESSAGE_LENGTH_LIMIT +                        Restrict the length of the **first line** of the +                        commit message; 0 for no limit. + diff --git a/docs/images/cli_help/cz_commit___help.svg b/docs/images/cli_help/cz_commit___help.svg index 1905186bb..eea16ac14 100644 --- a/docs/images/cli_help/cz_commit___help.svg +++ b/docs/images/cli_help/cz_commit___help.svg @@ -19,104 +19,104 @@ font-weight: 700; } - .terminal-1022884229-matrix { + .terminal-517664947-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-1022884229-title { + .terminal-517664947-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-1022884229-r1 { fill: #c5c8c6 } -.terminal-1022884229-r2 { fill: #c5c8c6;font-weight: bold } -.terminal-1022884229-r3 { fill: #68a0b3;font-weight: bold } + .terminal-517664947-r1 { fill: #c5c8c6 } +.terminal-517664947-r2 { fill: #c5c8c6;font-weight: bold } +.terminal-517664947-r3 { fill: #68a0b3;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -128,36 +128,36 @@ - + - - $ cz commit --help -usage: cz commit [-h][--retry][--no-retry][--dry-run] -[--write-message-to-file FILE_PATH][-s][-a][-e] -[-l MESSAGE_LENGTH_LIMIT][--] - -Create new commit - -options: -  -h, --help            show this help message and exit -  --retry               Retry the last commit. -  --no-retry            Skip retry if --retry or `retry_after_failure` is set -                        to true. -  --dry-run             Perform a dry run, without committing or modifying -                        files. -  --write-message-to-file FILE_PATH -                        Write message to FILE_PATH before committing (can be -                        used with --dry-run). -  -s, --signoff         Deprecated, use `cz commit -- -s` instead. -  -a, --all             Automatically stage files that have been modified and -                        deleted, but new files you have not told Git about are -                        not affected. -  -e, --edit            Edit the commit message before committing. -  -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT -                        Set the length limit of the commit message; 0 for no -                        limit. -  --                    Positional arguments separator (recommended). - + + $ cz commit --help +usage: cz commit [-h][--retry][--no-retry][--dry-run] +[--write-message-to-file FILE_PATH][-s][-a][-e] +[-l MESSAGE_LENGTH_LIMIT][--] + +Create new commit + +options: +  -h, --help            show this help message and exit +  --retry               Retry the last commit. +  --no-retry            Skip retry if --retry or `retry_after_failure` is set +                        to true. +  --dry-run             Perform a dry run, without committing or modifying +                        files. +  --write-message-to-file FILE_PATH +                        Write message to FILE_PATH before committing (can be +                        used with --dry-run). +  -s, --signoff         Deprecated, use `cz commit -- -s` instead. +  -a, --all             Automatically stage files that have been modified and +                        deleted, but new files you have not told Git about are +                        not affected. +  -e, --edit            Edit the commit message before committing. +  -l, --message-length-limit MESSAGE_LENGTH_LIMIT +                        Set the length limit of the commit message; 0 for no +                        limit. +  --                    Positional arguments separator (recommended). + diff --git a/docs/images/cli_help/cz_example___help.svg b/docs/images/cli_help/cz_example___help.svg index 6bf85336b..5ac29a22e 100644 --- a/docs/images/cli_help/cz_example___help.svg +++ b/docs/images/cli_help/cz_example___help.svg @@ -19,46 +19,46 @@ font-weight: 700; } - .terminal-1249345926-matrix { + .terminal-703430360-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-1249345926-title { + .terminal-703430360-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-1249345926-r1 { fill: #c5c8c6 } -.terminal-1249345926-r2 { fill: #c5c8c6;font-weight: bold } + .terminal-703430360-r1 { fill: #c5c8c6 } +.terminal-703430360-r2 { fill: #c5c8c6;font-weight: bold } - + - + - + - + - + - + - + - + @@ -70,17 +70,17 @@ - + - - $ cz example --help -usage: cz example [-h] - -Show commit example - -options: -  -h, --help  show this help message and exit - + + $ cz example --help +usage: cz example [-h] + +Show commit example + +options: +  -h, --help  show this help message and exit + diff --git a/docs/images/cli_help/cz_info___help.svg b/docs/images/cli_help/cz_info___help.svg index 5ab81ec05..63ce1ee39 100644 --- a/docs/images/cli_help/cz_info___help.svg +++ b/docs/images/cli_help/cz_info___help.svg @@ -19,46 +19,46 @@ font-weight: 700; } - .terminal-3780805296-matrix { + .terminal-3108929538-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3780805296-title { + .terminal-3108929538-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3780805296-r1 { fill: #c5c8c6 } -.terminal-3780805296-r2 { fill: #c5c8c6;font-weight: bold } + .terminal-3108929538-r1 { fill: #c5c8c6 } +.terminal-3108929538-r2 { fill: #c5c8c6;font-weight: bold } - + - + - + - + - + - + - + - + @@ -70,17 +70,17 @@ - + - - $ cz info --help -usage: cz info [-h] - -Show information about the cz - -options: -  -h, --help  show this help message and exit - + + $ cz info --help +usage: cz info [-h] + +Show information about the cz + +options: +  -h, --help  show this help message and exit + diff --git a/docs/images/cli_help/cz_init___help.svg b/docs/images/cli_help/cz_init___help.svg index 709b77918..daf7d90cd 100644 --- a/docs/images/cli_help/cz_init___help.svg +++ b/docs/images/cli_help/cz_init___help.svg @@ -19,46 +19,46 @@ font-weight: 700; } - .terminal-3508504009-matrix { + .terminal-2562163483-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3508504009-title { + .terminal-2562163483-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3508504009-r1 { fill: #c5c8c6 } -.terminal-3508504009-r2 { fill: #c5c8c6;font-weight: bold } + .terminal-2562163483-r1 { fill: #c5c8c6 } +.terminal-2562163483-r2 { fill: #c5c8c6;font-weight: bold } - + - + - + - + - + - + - + - + @@ -70,17 +70,17 @@ - + - - $ cz init --help -usage: cz init [-h] - -Initialize commitizen configuration - -options: -  -h, --help  show this help message and exit - + + $ cz init --help +usage: cz init [-h] + +Initialize commitizen configuration + +options: +  -h, --help  show this help message and exit + diff --git a/docs/images/cli_help/cz_ls___help.svg b/docs/images/cli_help/cz_ls___help.svg index fc6e0bc7e..27bd6b760 100644 --- a/docs/images/cli_help/cz_ls___help.svg +++ b/docs/images/cli_help/cz_ls___help.svg @@ -19,46 +19,46 @@ font-weight: 700; } - .terminal-4097343530-matrix { + .terminal-3771170172-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-4097343530-title { + .terminal-3771170172-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-4097343530-r1 { fill: #c5c8c6 } -.terminal-4097343530-r2 { fill: #c5c8c6;font-weight: bold } + .terminal-3771170172-r1 { fill: #c5c8c6 } +.terminal-3771170172-r2 { fill: #c5c8c6;font-weight: bold } - + - + - + - + - + - + - + - + @@ -70,17 +70,17 @@ - + - - $ cz ls --help -usage: cz ls [-h] - -Show available Commitizens - -options: -  -h, --help  show this help message and exit - + + $ cz ls --help +usage: cz ls [-h] + +Show available Commitizens + +options: +  -h, --help  show this help message and exit + diff --git a/docs/images/cli_help/cz_schema___help.svg b/docs/images/cli_help/cz_schema___help.svg index 110569a02..3a0098b2d 100644 --- a/docs/images/cli_help/cz_schema___help.svg +++ b/docs/images/cli_help/cz_schema___help.svg @@ -19,46 +19,46 @@ font-weight: 700; } - .terminal-1104904213-matrix { + .terminal-721452391-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-1104904213-title { + .terminal-721452391-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-1104904213-r1 { fill: #c5c8c6 } -.terminal-1104904213-r2 { fill: #c5c8c6;font-weight: bold } + .terminal-721452391-r1 { fill: #c5c8c6 } +.terminal-721452391-r2 { fill: #c5c8c6;font-weight: bold } - + - + - + - + - + - + - + - + @@ -70,17 +70,17 @@ - + - - $ cz schema --help -usage: cz schema [-h] - -Show commit schema - -options: -  -h, --help  show this help message and exit - + + $ cz schema --help +usage: cz schema [-h] + +Show commit schema + +options: +  -h, --help  show this help message and exit + diff --git a/docs/images/cli_help/cz_version___help.svg b/docs/images/cli_help/cz_version___help.svg index 0c45576bc..20331e097 100644 --- a/docs/images/cli_help/cz_version___help.svg +++ b/docs/images/cli_help/cz_version___help.svg @@ -19,82 +19,82 @@ font-weight: 700; } - .terminal-3401796841-matrix { + .terminal-1926777403-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3401796841-title { + .terminal-1926777403-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3401796841-r1 { fill: #c5c8c6 } -.terminal-3401796841-r2 { fill: #c5c8c6;font-weight: bold } + .terminal-1926777403-r1 { fill: #c5c8c6 } +.terminal-1926777403-r2 { fill: #c5c8c6;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -106,29 +106,29 @@ - + - - $ cz version --help -usage: cz version [-h][-r | -p | -c | -v][--major | --minor | --tag] - -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      Output the system information for reporting bugs. -  -p, --project     Output the version of the current project. -  -c, --commitizen  Output the version of the installed commitizen. -  -v, --verbose     Output the version of both the installed commitizen and -                    the current project. -  --major           Output just the major version. Must be used with --project -                    or --verbose. -  --minor           Output just the minor version. Must be used with --project -                    or --verbose. -  --tag             get the version with tag prefix. Need to be used with -                    --project or --verbose. - + + $ cz version --help +usage: cz version [-h][-r | -p | -c | -v][--major | --minor | --tag] + +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      Output the system information for reporting bugs. +  -p, --project     Output the version of the current project. +  -c, --commitizen  Output the version of the installed commitizen. +  -v, --verbose     Output the version of both the installed commitizen and +                    the current project. +  --major           Output just the major version. Must be used with --project +                    or --verbose. +  --minor           Output just the minor version. Must be used with --project +                    or --verbose. +  --tag             get the version with tag prefix. Need to be used with +                    --project or --verbose. + diff --git a/scripts/gen_cli_help_screenshots.py b/scripts/gen_cli_help_screenshots.py index 070661239..35dee8a97 100644 --- a/scripts/gen_cli_help_screenshots.py +++ b/scripts/gen_cli_help_screenshots.py @@ -1,42 +1,44 @@ import os import subprocess +from itertools import chain from pathlib import Path from rich.console import Console from commitizen.cli import data -project_root = Path(__file__).parent.parent.absolute() -images_root = project_root / Path("docs") / Path("images") / Path("cli_help") - def gen_cli_help_screenshots() -> None: """Generate the screenshot for help message on each cli command and save them as svg files.""" - if not os.path.exists(images_root): - os.makedirs(images_root) - print(f"Created {images_root}") - - help_cmds = _list_help_cmds() - for cmd in help_cmds: + images_root = Path(__file__).parent.parent / "docs" / "images" / "cli_help" + images_root.mkdir(parents=True, exist_ok=True) + + cz_commands = ( + command["name"] if isinstance(command["name"], str) else command["name"][0] + for command in data["subcommands"]["commands"] + ) + for cmd in chain( + ["cz --help"], (f"cz {cz_command} --help" for cz_command in cz_commands) + ): file_name = f"{cmd.replace(' ', '_').replace('-', '_')}.svg" - _export_cmd_as_svg(cmd, f"{images_root}/{file_name}") - + _export_cmd_as_svg(cmd, images_root / file_name) -def _list_help_cmds() -> list[str]: - cmds = [f"{data['prog']} --help"] + [ - f"{data['prog']} {sub_c['name'] if isinstance(sub_c['name'], str) else sub_c['name'][0]} --help" - for sub_c in data["subcommands"]["commands"] - ] - return cmds +def _export_cmd_as_svg(cmd: str, file_path: Path) -> None: + console = Console(record=True, width=80, file=open(os.devnull, "w")) + print("Processing command:", cmd) -def _export_cmd_as_svg(cmd: str, file_name: str) -> None: + console.print(f"$ {cmd}") stdout = subprocess.run(cmd, shell=True, capture_output=True).stdout.decode("utf-8") - console = Console(record=True, width=80) - console.print(f"$ {cmd}\n{stdout}") - console.save_svg(file_name, title="") + console.print(stdout) + console.save_svg(file_path.as_posix(), title="") + + print("Saved to:", file_path.as_posix()) + +# TODO: generate the screenshot of cz init interactive mode +# TODO: generate the screenshot of cz commit interactive mode if __name__ == "__main__": gen_cli_help_screenshots() From 003254724bbb27c392714ba5c7d205523af7a30f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Feb 2026 03:47:50 +0000 Subject: [PATCH 6/8] docs(cli/screenshots): update CLI screenshots [skip ci] --- docs/images/cli_help/cz___help.svg | 166 ++++---- docs/images/cli_help/cz_bump___help.svg | 380 ++++++++++--------- docs/images/cli_help/cz_changelog___help.svg | 198 +++++----- docs/images/cli_help/cz_check___help.svg | 150 ++++---- docs/images/cli_help/cz_commit___help.svg | 122 +++--- 5 files changed, 514 insertions(+), 502 deletions(-) diff --git a/docs/images/cli_help/cz___help.svg b/docs/images/cli_help/cz___help.svg index fcaf6ef5b..5c8f8fef3 100644 --- a/docs/images/cli_help/cz___help.svg +++ b/docs/images/cli_help/cz___help.svg @@ -19,136 +19,136 @@ font-weight: 700; } - .terminal-607367767-matrix { + .terminal-1104329960-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-607367767-title { + .terminal-1104329960-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-607367767-r1 { fill: #c5c8c6 } -.terminal-607367767-r2 { fill: #c5c8c6;font-weight: bold } -.terminal-607367767-r3 { fill: #d0b344 } -.terminal-607367767-r4 { fill: #1984e9;text-decoration: underline; } -.terminal-607367767-r5 { fill: #68a0b3;font-weight: bold } + .terminal-1104329960-r1 { fill: #c5c8c6 } +.terminal-1104329960-r2 { fill: #c5c8c6;font-weight: bold } +.terminal-1104329960-r3 { fill: #d0b344 } +.terminal-1104329960-r4 { fill: #1984e9;text-decoration: underline; } +.terminal-1104329960-r5 { fill: #68a0b3;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -160,46 +160,46 @@ - + - - $ cz --help -usage: cz [-h][--config CONFIG][--debug][-n NAME][-nr NO_RAISE] -{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} -... - -Commitizen is a powerful release management tool that helps teams maintain  -consistent and meaningful commit messages while automating version management. -For more information, please visit https://commitizen-tools.github.io/commitizen - -options: -  -h, --help            show this help message and exit -  --config CONFIG       The path to the configuration file. -  --debug               Use debug mode. -  -n, --name NAME       Use the given commitizen (default: -                        cz_conventional_commits). -  -nr, --no-raise NO_RAISE -                        Comma-separated error codes that won't raise error, -                        e.g., cz -nr 1,2,3 bump. See codes at -https://commitizen- -                        tools.github.io/commitizen/exit_codes/ - -commands: -{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} -    init                Initialize commitizen configuration. -    commit (c)          Create new commit. -    ls                  Show available Commitizens. -    example             Show commit example. -    info                Show information about the cz. -    schema              Show commit schema. -    bump                Bump semantic version based on the git log. -    changelog (ch)      Generate changelog (note that it will overwrite -                        existing files). -    check               Validate that a commit message matches the commitizen -                        schema. -    version             Get the version of the installed commitizen or the -                        current project (default: installed commitizen). - + + $ cz --help +usage: cz [-h][--config CONFIG][--debug][-n NAME][-nr NO_RAISE] +{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} +... + +Commitizen is a powerful release management tool that helps teams maintain  +consistent and meaningful commit messages while automating version management. +For more information, please visit https://commitizen-tools.github.io/commitizen + +options: +  -h, --help            show this help message and exit +  --config CONFIG       The path to the configuration file. +  --debug               Use debug mode. +  -n NAME, --name NAME  Use the given commitizen (default: +                        cz_conventional_commits). +  -nr NO_RAISE, --no-raise NO_RAISE +                        Comma-separated error codes that won't raise error, +                        e.g., cz -nr 1,2,3 bump. See codes at +https://commitizen- +                        tools.github.io/commitizen/exit_codes/ + +commands: +{init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} +    init                Initialize commitizen configuration. +    commit (c)          Create new commit. +    ls                  Show available Commitizens. +    example             Show commit example. +    info                Show information about the cz. +    schema              Show commit schema. +    bump                Bump semantic version based on the git log. +    changelog (ch)      Generate changelog (note that it will overwrite +                        existing files). +    check               Validate that a commit message matches the commitizen +                        schema. +    version             Get the version of the installed commitizen or the +                        current project (default: installed commitizen). + diff --git a/docs/images/cli_help/cz_bump___help.svg b/docs/images/cli_help/cz_bump___help.svg index e29b71cd8..42f618ea9 100644 --- a/docs/images/cli_help/cz_bump___help.svg +++ b/docs/images/cli_help/cz_bump___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - - $ cz bump --help -usage: cz bump [-h][--dry-run][--files-only][--version-files-only] -[--local-version][--changelog][--no-verify][--yes] -[--tag-format TAG_FORMAT][--bump-message BUMP_MESSAGE] -[--prerelease {alpha,beta,rc}][--devrelease DEVRELEASE] -[--increment {MAJOR,MINOR,PATCH}] -[--increment-mode {linear,exact}][--check-consistency] -[--annotated-tag] -[--annotated-tag-message ANNOTATED_TAG_MESSAGE][--gpg-sign] -[--changelog-to-stdout][--git-output-to-stderr][--retry] -[--major-version-zero][--template TEMPLATE][--extra EXTRA] -[--file-name FILE_NAME][--prerelease-offset PRERELEASE_OFFSET] -[--version-scheme {pep440,semver,semver2}] -[--version-type {pep440,semver,semver2}] -[--build-metadata BUILD_METADATA][--get-next] -[--allow-no-commit] -[MANUAL_VERSION] - -Bump semantic version based on the git log - -positional arguments: -  MANUAL_VERSION        Bump to the given version (e.g., 1.5.3). - -options: -  -h, --help            show this help message and exit -  --dry-run             Perform a dry run, without committing or modifying -                        files. -  --files-only          Bump version in the `version_files` specified in the -                        configuration file only(deprecated; use --version- -                        files-only instead). -  --version-files-only  Bump version in the files from the config -  --local-version       Bump version only the local version portion (ignoring -                        the public version). -  --changelog, -ch      Generate the changelog for the latest version. -  --no-verify           Bypass the pre-commit and commit-msg hooks. -  --yes                 Accept automatically answered questions. -  --tag-format TAG_FORMAT -                        The format used to tag the commit and read it. Use it -                        in existing projects, and wrap around simple quotes. -  --bump-message BUMP_MESSAGE -                        Template used to create the release commit, useful -                        when working with CI. -  --prerelease, -pr {alpha,beta,rc} -                        Type of prerelease. -  --devrelease, -d DEVRELEASE -                        Specify non-negative integer for dev release. -  --increment {MAJOR,MINOR,PATCH} -                        Specify the desired increment. -  --increment-mode {linear,exact} -                        Set the method by which the new version is chosen. -'linear'(default) resolves the next version based on -                        typical linear version progression, where bumping of a -                        pre-release with lower precedence than the current -                        pre-release phase maintains the current phase of -                        higher precedence. 'exact' applies the changes that -                        have been specified (or determined from the commit -                        log) without interpretation, ensuring the increment -                        and pre-release are always honored. -  --check-consistency, -cc -                        Check consistency among versions defined in Commitizen -                        configuration file and `version_files`. -  --annotated-tag, -at  Create annotated tag instead of lightweight one. -  --annotated-tag-message, -atm ANNOTATED_TAG_MESSAGE -                        Create annotated tag message. -  --gpg-sign, -s        Sign tag instead of lightweight one. -  --changelog-to-stdout -                        Output changelog to stdout. -  --git-output-to-stderr -                        Redirect git output to stderr. -  --retry               Retry commit if it fails for the first time. -  --major-version-zero  Keep major version at zero, even for breaking changes. -  --template, -t TEMPLATE -                        Changelog template file name (relative to the current -                        working directory). -  --extra, -e EXTRA     Changelog extra variables (in the form 'key=value'). -  --file-name FILE_NAME -                        File name of changelog (default: 'CHANGELOG.md'). -  --prerelease-offset PRERELEASE_OFFSET -                        Start pre-releases with this offset. -  --version-scheme {pep440,semver,semver2} -                        Choose version scheme. -  --version-type {pep440,semver,semver2} -                        Deprecated, use `--version-scheme` instead. -  --build-metadata BUILD_METADATA -                        Add additional build-metadata to the version-number. -  --get-next            Determine the next version and write to stdout. -  --allow-no-commit     Bump version without eligible commits. - + + $ cz bump --help +usage: cz bump [-h][--dry-run][--files-only][--version-files-only] +[--local-version][--changelog][--no-verify][--yes] +[--tag-format TAG_FORMAT][--bump-message BUMP_MESSAGE] +[--prerelease {alpha,beta,rc}][--devrelease DEVRELEASE] +[--increment {MAJOR,MINOR,PATCH}] +[--increment-mode {linear,exact}][--check-consistency] +[--annotated-tag] +[--annotated-tag-message ANNOTATED_TAG_MESSAGE][--gpg-sign] +[--changelog-to-stdout][--git-output-to-stderr][--retry] +[--major-version-zero][--template TEMPLATE][--extra EXTRA] +[--file-name FILE_NAME][--prerelease-offset PRERELEASE_OFFSET] +[--version-scheme {pep440,semver,semver2}] +[--version-type {pep440,semver,semver2}] +[--build-metadata BUILD_METADATA][--get-next] +[--allow-no-commit] +[MANUAL_VERSION] + +Bump semantic version based on the git log + +positional arguments: +  MANUAL_VERSION        Bump to the given version (e.g., 1.5.3). + +options: +  -h, --help            show this help message and exit +  --dry-run             Perform a dry run, without committing or modifying +                        files. +  --files-only          Bump version in the `version_files` specified in the +                        configuration file only(deprecated; use --version- +                        files-only instead). +  --version-files-only  Bump version in the files from the config +  --local-version       Bump version only the local version portion (ignoring +                        the public version). +  --changelog, -ch      Generate the changelog for the latest version. +  --no-verify           Bypass the pre-commit and commit-msg hooks. +  --yes                 Accept automatically answered questions. +  --tag-format TAG_FORMAT +                        The format used to tag the commit and read it. Use it +                        in existing projects, and wrap around simple quotes. +  --bump-message BUMP_MESSAGE +                        Template used to create the release commit, useful +                        when working with CI. +  --prerelease {alpha,beta,rc}, -pr {alpha,beta,rc} +                        Type of prerelease. +  --devrelease DEVRELEASE, -d DEVRELEASE +                        Specify non-negative integer for dev release. +  --increment {MAJOR,MINOR,PATCH} +                        Specify the desired increment. +  --increment-mode {linear,exact} +                        Set the method by which the new version is chosen. +'linear'(default) resolves the next version based on +                        typical linear version progression, where bumping of a +                        pre-release with lower precedence than the current +                        pre-release phase maintains the current phase of +                        higher precedence. 'exact' applies the changes that +                        have been specified (or determined from the commit +                        log) without interpretation, ensuring the increment +                        and pre-release are always honored. +  --check-consistency, -cc +                        Check consistency among versions defined in Commitizen +                        configuration file and `version_files`. +  --annotated-tag, -at  Create annotated tag instead of lightweight one. +  --annotated-tag-message ANNOTATED_TAG_MESSAGE, -atm ANNOTATED_TAG_MESSAGE +                        Create annotated tag message. +  --gpg-sign, -s        Sign tag instead of lightweight one. +  --changelog-to-stdout +                        Output changelog to stdout. +  --git-output-to-stderr +                        Redirect git output to stderr. +  --retry               Retry commit if it fails for the first time. +  --major-version-zero  Keep major version at zero, even for breaking changes. +  --template TEMPLATE, -t TEMPLATE +                        Changelog template file name (relative to the current +                        working directory). +  --extra EXTRA, -e EXTRA +                        Changelog extra variables (in the form 'key=value'). +  --file-name FILE_NAME +                        File name of changelog (default: 'CHANGELOG.md'). +  --prerelease-offset PRERELEASE_OFFSET +                        Start pre-releases with this offset. +  --version-scheme {pep440,semver,semver2} +                        Choose version scheme. +  --version-type {pep440,semver,semver2} +                        Deprecated, use `--version-scheme` instead. +  --build-metadata BUILD_METADATA +                        Add additional build-metadata to the version-number. +  --get-next            Determine the next version and write to stdout. +  --allow-no-commit     Bump version without eligible commits. + diff --git a/docs/images/cli_help/cz_changelog___help.svg b/docs/images/cli_help/cz_changelog___help.svg index e02d9cd23..00031d48f 100644 --- a/docs/images/cli_help/cz_changelog___help.svg +++ b/docs/images/cli_help/cz_changelog___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - - $ cz changelog --help -usage: cz changelog [-h][--dry-run][--file-name FILE_NAME] -[--unreleased-version UNRELEASED_VERSION][--incremental] -[--start-rev START_REV][--merge-prerelease] -[--version-scheme {pep440,semver,semver2}] -[--export-template EXPORT_TEMPLATE][--template TEMPLATE] -[--extra EXTRA][--tag-format TAG_FORMAT] - - -Generate changelog (note that it will overwrite existing files) - -positional arguments: -  rev_range             Generate changelog for the given version (e.g., 1.5.3) -                        or version range (e.g., 1.5.3..1.7.9). - -options: -  -h, --help            show this help message and exit -  --dry-run             Show changelog to stdout. -  --file-name FILE_NAME -                        File name of changelog (default: 'CHANGELOG.md'). -  --unreleased-version UNRELEASED_VERSION -                        Set the value for the new version (use the tag value), -                        instead of using unreleased versions. -  --incremental         Generate changelog from the last created version, -                        useful if the changelog has been manually modified. -  --start-rev START_REV -                        Start rev of the changelog. If not set, it will -                        generate changelog from the beginning. -  --merge-prerelease    Collect all changes from prereleases into the next -                        non-prerelease. If not set, it will include -                        prereleases in the changelog. -  --version-scheme {pep440,semver,semver2} -                        Choose version scheme. -  --export-template EXPORT_TEMPLATE -                        Export the changelog template into this file instead -                        of rendering it. -  --template, -t TEMPLATE -                        Changelog template file name (relative to the current -                        working directory). -  --extra, -e EXTRA     Changelog extra variables (in the form 'key=value'). -  --tag-format TAG_FORMAT -                        The format of the tag, wrap around simple quotes. - + + $ cz changelog --help +usage: cz changelog [-h][--dry-run][--file-name FILE_NAME] +[--unreleased-version UNRELEASED_VERSION][--incremental] +[--start-rev START_REV][--merge-prerelease] +[--version-scheme {pep440,semver,semver2}] +[--export-template EXPORT_TEMPLATE][--template TEMPLATE] +[--extra EXTRA][--tag-format TAG_FORMAT] + + +Generate changelog (note that it will overwrite existing files) + +positional arguments: +  rev_range             Generate changelog for the given version (e.g., 1.5.3) +                        or version range (e.g., 1.5.3..1.7.9). + +options: +  -h, --help            show this help message and exit +  --dry-run             Show changelog to stdout. +  --file-name FILE_NAME +                        File name of changelog (default: 'CHANGELOG.md'). +  --unreleased-version UNRELEASED_VERSION +                        Set the value for the new version (use the tag value), +                        instead of using unreleased versions. +  --incremental         Generate changelog from the last created version, +                        useful if the changelog has been manually modified. +  --start-rev START_REV +                        Start rev of the changelog. If not set, it will +                        generate changelog from the beginning. +  --merge-prerelease    Collect all changes from prereleases into the next +                        non-prerelease. If not set, it will include +                        prereleases in the changelog. +  --version-scheme {pep440,semver,semver2} +                        Choose version scheme. +  --export-template EXPORT_TEMPLATE +                        Export the changelog template into this file instead +                        of rendering it. +  --template TEMPLATE, -t TEMPLATE +                        Changelog template file name (relative to the current +                        working directory). +  --extra EXTRA, -e EXTRA +                        Changelog extra variables (in the form 'key=value'). +  --tag-format TAG_FORMAT +                        The format of the tag, wrap around simple quotes. + diff --git a/docs/images/cli_help/cz_check___help.svg b/docs/images/cli_help/cz_check___help.svg index 8b17e03f1..57dd5ee1a 100644 --- a/docs/images/cli_help/cz_check___help.svg +++ b/docs/images/cli_help/cz_check___help.svg @@ -1,4 +1,4 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + - + - + - - $ cz check --help -usage: cz check [-h][--commit-msg-file COMMIT_MSG_FILE | -                --rev-range REV_RANGE | -d | -m MESSAGE][--allow-abort] -[--allowed-prefixes [ALLOWED_PREFIXES ...]] -[-l MESSAGE_LENGTH_LIMIT] - -Validate that a commit message matches the commitizen schema - -options: -  -h, --help            show this help message and exit -  --commit-msg-file COMMIT_MSG_FILE -                        Ask for the name of the temporary file that contains -                        the commit message. Use it in a git hook script: -MSG_FILE=$1. -  --rev-range REV_RANGE -                        Validate the commits in the given range of git rev, -                        e.g., master..HEAD. -  -d, --use-default-range -                        Validate the commits from the default branch to HEAD, -                        e.g., refs/remotes/origin/master..HEAD. -  -m, --message MESSAGE -                        Validate the given commit message. -  --allow-abort         Allow empty commit messages, which typically abort a -                        commit. -  --allowed-prefixes [ALLOWED_PREFIXES ...] -                        Skip validation for commit messages that start with -                        the specified prefixes. -  -l, --message-length-limit MESSAGE_LENGTH_LIMIT -                        Restrict the length of the **first line** of the -                        commit message; 0 for no limit. - + + $ cz check --help +usage: cz check [-h] +[--commit-msg-file COMMIT_MSG_FILE | --rev-range REV_RANGE | -d  +| -m MESSAGE] +[--allow-abort][--allowed-prefixes [ALLOWED_PREFIXES ...]] +[-l MESSAGE_LENGTH_LIMIT] + +Validate that a commit message matches the commitizen schema + +options: +  -h, --help            show this help message and exit +  --commit-msg-file COMMIT_MSG_FILE +                        Ask for the name of the temporary file that contains +                        the commit message. Use it in a git hook script: +MSG_FILE=$1. +  --rev-range REV_RANGE +                        Validate the commits in the given range of git rev, +                        e.g., master..HEAD. +  -d, --use-default-range +                        Validate the commits from the default branch to HEAD, +                        e.g., refs/remotes/origin/master..HEAD. +  -m MESSAGE, --message MESSAGE +                        Validate the given commit message. +  --allow-abort         Allow empty commit messages, which typically abort a +                        commit. +  --allowed-prefixes [ALLOWED_PREFIXES ...] +                        Skip validation for commit messages that start with +                        the specified prefixes. +  -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT +                        Restrict the length of the **first line** of the +                        commit message; 0 for no limit. + diff --git a/docs/images/cli_help/cz_commit___help.svg b/docs/images/cli_help/cz_commit___help.svg index eea16ac14..633cea8fd 100644 --- a/docs/images/cli_help/cz_commit___help.svg +++ b/docs/images/cli_help/cz_commit___help.svg @@ -19,104 +19,104 @@ font-weight: 700; } - .terminal-517664947-matrix { + .terminal-2417358551-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-517664947-title { + .terminal-2417358551-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-517664947-r1 { fill: #c5c8c6 } -.terminal-517664947-r2 { fill: #c5c8c6;font-weight: bold } -.terminal-517664947-r3 { fill: #68a0b3;font-weight: bold } + .terminal-2417358551-r1 { fill: #c5c8c6 } +.terminal-2417358551-r2 { fill: #c5c8c6;font-weight: bold } +.terminal-2417358551-r3 { fill: #68a0b3;font-weight: bold } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -128,36 +128,36 @@ - + - - $ cz commit --help -usage: cz commit [-h][--retry][--no-retry][--dry-run] -[--write-message-to-file FILE_PATH][-s][-a][-e] -[-l MESSAGE_LENGTH_LIMIT][--] - -Create new commit - -options: -  -h, --help            show this help message and exit -  --retry               Retry the last commit. -  --no-retry            Skip retry if --retry or `retry_after_failure` is set -                        to true. -  --dry-run             Perform a dry run, without committing or modifying -                        files. -  --write-message-to-file FILE_PATH -                        Write message to FILE_PATH before committing (can be -                        used with --dry-run). -  -s, --signoff         Deprecated, use `cz commit -- -s` instead. -  -a, --all             Automatically stage files that have been modified and -                        deleted, but new files you have not told Git about are -                        not affected. -  -e, --edit            Edit the commit message before committing. -  -l, --message-length-limit MESSAGE_LENGTH_LIMIT -                        Set the length limit of the commit message; 0 for no -                        limit. -  --                    Positional arguments separator (recommended). - + + $ cz commit --help +usage: cz commit [-h][--retry][--no-retry][--dry-run] +[--write-message-to-file FILE_PATH][-s][-a][-e] +[-l MESSAGE_LENGTH_LIMIT][--] + +Create new commit + +options: +  -h, --help            show this help message and exit +  --retry               Retry the last commit. +  --no-retry            Skip retry if --retry or `retry_after_failure` is set +                        to true. +  --dry-run             Perform a dry run, without committing or modifying +                        files. +  --write-message-to-file FILE_PATH +                        Write message to FILE_PATH before committing (can be +                        used with --dry-run). +  -s, --signoff         Deprecated, use `cz commit -- -s` instead. +  -a, --all             Automatically stage files that have been modified and +                        deleted, but new files you have not told Git about are +                        not affected. +  -e, --edit            Edit the commit message before committing. +  -l MESSAGE_LENGTH_LIMIT, --message-length-limit MESSAGE_LENGTH_LIMIT +                        Set the length limit of the commit message; 0 for no +                        limit. +  --                    Positional arguments separator (recommended). + From 75266a6e425558ba7799d83af39678b8cf83b93d Mon Sep 17 00:00:00 2001 From: YU HAN-CHENG Date: Wed, 4 Feb 2026 19:05:03 +0800 Subject: [PATCH 7/8] fix(pre-commit-hooks): correct rev-range syntax in commitizen-branch (#1841) --- .pre-commit-hooks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index c14263458..d57006f15 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -19,9 +19,10 @@ the fact (e.g., pre-push or in CI) without an expensive check of the entire repository history. entry: cz check - args: [--rev-range, origin/HEAD..HEAD] + args: [--rev-range, "$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF"] always_run: true pass_filenames: false language: python language_version: python3 minimum_pre_commit_version: "3.2.0" + stages: [pre-push] From a6db54ca544983a27239322ba21df0d30ce0b001 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 4 Feb 2026 11:05:33 +0000 Subject: [PATCH 8/8] =?UTF-8?q?bump:=20version=204.13.3=20=E2=86=92=204.13?= =?UTF-8?q?.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 6 ++++++ commitizen/__version__.py | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fed5bc709..6e56cb341 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.3 # automatically updated by Commitizen + rev: v4.13.4 # automatically updated by Commitizen hooks: - id: commitizen - id: commitizen-branch diff --git a/CHANGELOG.md b/CHANGELOG.md index 8659d787b..1d70b41f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v4.13.4 (2026-02-04) + +### Fix + +- **pre-commit-hooks**: correct rev-range syntax in commitizen-branch (#1841) + ## v4.13.3 (2026-02-04) ### Refactor diff --git a/commitizen/__version__.py b/commitizen/__version__.py index fd447e0fb..8718ed682 100644 --- a/commitizen/__version__.py +++ b/commitizen/__version__.py @@ -1 +1 @@ -__version__ = "4.13.3" +__version__ = "4.13.4" diff --git a/pyproject.toml b/pyproject.toml index e174a2c38..ad9717794 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "commitizen" -version = "4.13.3" +version = "4.13.4" description = "Python commitizen client tool" authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }] maintainers = [ diff --git a/uv.lock b/uv.lock index 872ddd00f..ee8ce5c6c 100644 --- a/uv.lock +++ b/uv.lock @@ -195,7 +195,7 @@ wheels = [ [[package]] name = "commitizen" -version = "4.13.3" +version = "4.13.4" source = { editable = "." } dependencies = [ { name = "argcomplete" },