### Example Initialization Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/init.md An example showing how to start the initialization process and follow the interactive prompts. ```sh # Start the initialization process cz init # Follow the interactive prompts to configure your project ``` -------------------------------- ### Getting Help for Commands Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Examples of how to get detailed help for specific Commitizen commands. ```sh cz commit --help cz bump --help cz changelog --help ``` -------------------------------- ### Configuration Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-path.md Example of how to configure cz-path in a .cz.json file. ```json { "commitizen": { "name": "cz_path", "remove_path_prefixes": ["src", "module_name"] } } ``` -------------------------------- ### poetry example pyproject.toml Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md Example pyproject.toml file demonstrating the poetry version provider. ```toml [tool.poetry] name = "my-package" version = "0.1.0" # Managed by Commitizen ``` -------------------------------- ### cargo example Cargo.toml Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md Example Cargo.toml file demonstrating the cargo version provider. ```toml [package] name = "my-crate" version = "0.1.0" # Managed by Commitizen ``` -------------------------------- ### setup.py Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/customization/python_class.md Example setup.py file for packaging a custom Commitizen plugin. ```python from setuptools import setup setup( name="JiraCommitizen", version="0.1.0", py_modules=["cz_jira"], license="MIT", long_description="this is a long description", install_requires=["commitizen"], entry_points={"commitizen.plugin": ["cz_jira = cz_jira:JiraCz"]}, ) ``` -------------------------------- ### Example Session Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-path.md Demonstrates an example session of using cz-path for commit messages. ```plain $ git add .vscode/ $ cz -n cz_path c ? Prefix: (Use arrow keys) » .vscode .vscode/ project (empty) ? Prefix: .vscode ? Commit title: adjust settings .vscode: adjust settings [main 0000000] .vscode: adjust settings 2 files changed, 1 insertion(+), 11 deletions(-) Commit successful! ``` -------------------------------- ### pep621 example pyproject.toml Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md Example pyproject.toml file demonstrating the pep621 version provider. ```toml [project] name = "my-package" version = "0.1.0" # Managed by Commitizen ``` -------------------------------- ### Set up development environment Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/contributing/contributing.md Install development dependencies using uv. ```bash uv sync --dev --frozen ``` -------------------------------- ### Global Installation using uv Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Installs Commitizen globally using uv and provides a command to keep it updated. ```bash # Install commitizen uv tool install commitizen # Keep it updated uv tool upgrade commitizen ``` -------------------------------- ### Install prek Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/tutorials/auto_check.md Installs the prek framework using pip. ```sh python -m pip install prek ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Command to install Commitizen pre-commit hooks. ```sh prek install --hook-type commit-msg --hook-type pre-push ``` -------------------------------- ### Version Command Examples Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/version.md Examples demonstrating the usage of the `cz version` command with various flags and arguments. ```bash cz version --project cz version 2.0.0 --next MAJOR cz version --project --major cz version --verbose ``` -------------------------------- ### Setuptools Entrypoint Configuration Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/customization/python_class.md Example of how to expose a Commitizen plugin as an entrypoint in setuptools. ```python from setuptools import setup setup( name="MyPlugin", version="0.1.0", py_modules=["cz_plugin"], entry_points={"commitizen.plugin": ["plugin = cz_plugin:PluginCz"]}, ..., ) ``` -------------------------------- ### JSON Format Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/configuration_file.md Example of Commitizen configuration in a JSON file (.cz.json or cz.json). ```json { "commitizen": { "name": "cz_conventional_commits", "version": "0.1.0", "version_provider": "commitizen", "version_scheme": "pep440", "version_files": [ "src/__version__.py", "pyproject.toml:version" ], "tag_format": "$version", "update_changelog_on_bump": true, "changelog_file": "CHANGELOG.md", "changelog_incremental": false, "bump_message": "bump: version $current_version → $new_version", "gpg_sign": false, "annotated_tag": false, "major_version_zero": false, "prerelease_offset": 0, "retry_after_failure": false, "allow_abort": false, "message_length_limit": 0, "allowed_prefixes": [ "Merge", "Revert", "Pull request", "fixup!", "squash!", "amend!" ], "breaking_change_exclamation_in_title": false, "use_shortcuts": false, "pre_bump_hooks": [], "post_bump_hooks": [], "encoding": "utf-8", "style": [ ["qmark", "fg:#ff9d00 bold"], ["question", "bold"], ["answer", "fg:#ff9d00 bold"], ["pointer", "fg:#ff9d00 bold"], ["highlighted", "fg:#ff9d00 bold"], ["selected", "fg:#cc5454"], ["separator", "fg:#cc5454"], ["instruction", ""], ["text", ""], ["disabled", "fg:#858585 italic"] ] } } ``` -------------------------------- ### Installation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-conventional-gitmoji.md Install the cz-conventional-gitmoji package using pip. ```sh pip install cz-conventional-gitmoji ``` -------------------------------- ### Tag Format Example 1 Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Example of setting a custom tag format using the command line. ```bash cz bump --tag-format="v$version" ``` -------------------------------- ### YAML Format Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/configuration_file.md Example of Commitizen configuration in a YAML file (.cz.yaml or cz.yaml). ```yaml commitizen: name: cz_conventional_commits version: "0.1.0" version_provider: commitizen version_scheme: pep440 version_files: - src/__version__.py - pyproject.toml:version tag_format: "$version" update_changelog_on_bump: true changelog_file: CHANGELOG.md changelog_incremental: false bump_message: "bump: version $current_version → $new_version" gpg_sign: false annotated_tag: false major_version_zero: false prerelease_offset: 0 retry_after_failure: false allow_abort: false message_length_limit: 0 allowed_prefixes: - Merge - Revert - Pull request - fixup! - squash! - amend! breaking_change_exclamation_in_title: false use_shortcuts: false pre_bump_hooks: [] post_bump_hooks: [] encoding: utf-8 style: - - qmark - fg:#ff9d00 bold - - question - bold - - answer - fg:#ff9d00 bold - - pointer - fg:#ff9d00 bold - - highlighted - fg:#ff9d00 bold - - selected - fg:#cc5454 - - separator - fg:#cc5454 - - instruction - "" - - text - "" - - disabled - fg:#858585 italic ``` -------------------------------- ### Installation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/commitizen-deno-provider.md Install the commitizen-deno-provider package using pip. ```sh pip install commitizen-deno-provider ``` -------------------------------- ### TOML configuration example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/customization/config_file.md Example of Commitizen customization using TOML format, typically in pyproject.toml. ```toml [tool.commitizen] name = "cz_customize" [tool.commitizen.customize] message_template = "{{change_type}}:{% if show_message %} {{message}}{% endif %}" example = "feature: this feature enable customize through config file" schema = ": " schema_pattern = "(feature|bug fix):(\s.*)" bump_pattern = "^(break|new|fix|hotfix)" bump_map = {"break" = "MAJOR", "new" = "MINOR", "fix" = "PATCH", "hotfix" = "PATCH"} change_type_order = ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"] info_path = "cz_customize_info.txt" info = """ This is customized info """ commit_parser = "^(?Pfeature|bug fix):\s(?P.*)?" changelog_pattern = "^(feature|bug fix)?(!)?" change_type_map = {"feature" = "Feat", "bug fix" = "Fix"} [[tool.commitizen.customize.questions]] type = "list" name = "change_type" choices = [{value = "feature", name = "feature: A new feature."}, {value = "bug fix", name = "bug fix: A bug fix."}] # choices = ["feature", "fix"] # short version message = "Select the type of change you are committing" [[tool.commitizen.customize.questions]] type = "input" name = "message" message = "Body." [[tool.commitizen.customize.questions]] type = "confirm" name = "show_message" message = "Do you want to add body message in commit?" ``` -------------------------------- ### Installation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-path.md Install the cz-path plugin using pip. ```sh pip install cz-path ``` -------------------------------- ### Example package.json for NPM Provider Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md An example of a package.json file structure used by the npm version provider. ```json { "name": "my-package", "version": "0.1.0" } ``` -------------------------------- ### Tag Format Example 2 Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Example of setting a more complex custom tag format using the command line. ```bash cz bump --tag-format="v$minor.$major.$patch$prerelease.$devrelease" ``` -------------------------------- ### Installation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/conventional-jira.md Installs the conventional-JIRA plugin using pip. ```sh pip install conventional-JIRA ``` -------------------------------- ### Version Scheme Example - Command Line Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Example of setting the version scheme to semver2 via the command line. ```bash cz bump --version-scheme semver2 ``` -------------------------------- ### Installation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-legacy.md Command to install the cz_legacy plugin using pip. ```sh pip install cz_legacy ``` -------------------------------- ### Configuration Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/commitizen-deno-provider.md Example of how to configure commitizen to use the deno-provider in a .cz.yaml file. ```yaml --- commitizen: major_version_zero: true name: cz_conventional_commits tag_format: $version update_changelog_on_bump: true version_provider: deno-provider version_scheme: semver ``` -------------------------------- ### Global Installation using Homebrew (macOS) Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Installs Commitizen for macOS users using Homebrew. ```bash brew install commitizen ``` -------------------------------- ### Set up pre-commit hooks Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/contributing/contributing.md Install and configure pre-commit hooks using Poe. ```bash uv run poe setup-pre-commit ``` -------------------------------- ### Updated Version File Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/bump.md Shows the result of a version bump on the example JSON file, highlighting the changed version. ```diff { "name": "magictool", - "version": "1.2.3", + "version": "2.0.0", "dependencies": { "lodash": "1.2.3" } } ``` -------------------------------- ### TOML Format Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/configuration_file.md Example of Commitizen configuration in a TOML file (pyproject.toml, .cz.toml, or cz.toml). ```toml [tool.commitizen] name = "cz_conventional_commits" version = "0.1.0" version_provider = "commitizen" version_scheme = "pep440" version_files = [ "src/__version__.py", "pyproject.toml:version" ] tag_format = "$version" update_changelog_on_bump = true changelog_file = "CHANGELOG.md" changelog_incremental = false bump_message = "bump: version $current_version → $new_version" gpg_sign = false annotated_tag = false major_version_zero = false prerelease_offset = 0 retry_after_failure = false allow_abort = false message_length_limit = 0 allowed_prefixes = [ "Merge", "Revert", "Pull request", "fixup!", "squash!", "amend!" ] breaking_change_exclamation_in_title = false use_shortcuts = false pre_bump_hooks = [] post_bump_hooks = [] encoding = "utf-8" # Optional: Custom styling for prompts style = [ ["qmark", "fg:#ff9d00 bold"], ["question", "bold"], ["answer", "fg:#ff9d00 bold"], ["pointer", "fg:#ff9d00 bold"], ["highlighted", "fg:#ff9d00 bold"], ["selected", "fg:#cc5454"], ["separator", "fg:#cc5454"], ["instruction", ""], ["text", ""], ["disabled", "fg:#858585 italic"] ] ``` -------------------------------- ### Installation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/github-jira-conventional.md Command to install the cz-github-jira-conventional plugin using pip. ```sh pip install cz-github-jira-conventional ``` -------------------------------- ### Example composer.json for Composer Provider Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md An example of a composer.json file structure used by the composer version provider. ```json { "name": "vendor/package", "version": "0.1.0" } ``` -------------------------------- ### Bootstrap Source: https://github.com/commitizen-tools/commitizen/blob/master/AGENTS.md Commands to set up the development environment, including synchronizing dependencies and installing git hooks. ```bash uv sync --frozen --group base --group test --group linters uv run poe setup-pre-commit # install git hooks (uses prek, a pre-commit runner) ``` -------------------------------- ### JSON Configuration Source: https://github.com/commitizen-tools/commitizen/blob/master/tests/test_bump_update_version_in_files/test_update_version_in_files.txt Example of a JSON configuration file with version information. ```json { "name": "magictool", "version": "2.0.0", "dependencies": { "lodash": "2.0.0" } } ``` -------------------------------- ### Global Installation using pipx Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Installs Commitizen globally using pipx and provides a command to keep it updated. ```bash # Install Commitizen pipx install commitizen # Keep it updated pipx upgrade commitizen ``` -------------------------------- ### Commitizen Configuration Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/customization/config_file.md An example of a commitizen configuration file demonstrating customization options for version bumps, change type order, info messages, and questions for commit messages. ```yaml new: MINOR fix: PATCH hotfix: PATCH change_type_order: ['BREAKING CHANGE', 'feat', 'fix', 'refactor', 'perf'] info_path: cz_customize_info.txt info: This is customized info questions: - type: list name: change_type choices: - value: feature name: 'feature: A new feature.' - value: bug fix name: 'bug fix: A bug fix.' message: Select the type of change you are committing - type: input name: message message: 'Body.' - type: confirm name: show_message message: 'Do you want to add body message in commit?' ``` -------------------------------- ### Good Subject Line Examples Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/tutorials/writing_commits.md Examples of concise and clear subject lines for commit messages. ```markdown fix(commands): handle missing user input gracefully feat(api): add pagination support ``` -------------------------------- ### Scope Examples Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/tutorials/writing_commits.md Examples demonstrating the use of an optional scope to provide context about the affected codebase area. ```markdown feat(parser): add support for JSON arrays fix(api): handle null response gracefully ``` -------------------------------- ### Project-Specific Installation using uv Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Adds Commitizen to a Python project using uv. ```bash uv add --dev commitizen ``` -------------------------------- ### YAML Configuration Source: https://github.com/commitizen-tools/commitizen/blob/master/tests/test_bump_update_version_in_files/test_update_version_in_files.txt Example of a YAML configuration file with version information. ```yaml version: "3.3" services: app: image: my-repo/my-container:v2.0.0 command: my-command ``` -------------------------------- ### Installing Custom Provider (Editable Mode) Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md Bash command to install a custom Commitizen provider in editable mode for development. ```bash pip install -e . ``` -------------------------------- ### Yes Option Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Example of using the --yes flag to bypass interactive prompts. ```bash cz bump --yes ``` -------------------------------- ### Command Usage Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/init.md The basic command to start the Commitizen initialization process. ```sh cz init ``` -------------------------------- ### PEP621 Project Definition Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/faq.md Example of a [project] definition in pyproject.toml according to PEP621. ```toml [project] name = "spam" version = "2.5.1" ``` -------------------------------- ### Good vs. Poor Commit Message Examples Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/tutorials/writing_commits.md A comparison of good and poor examples for commit messages, covering subject lines and overall clarity. ```markdown | ✅ Good Examples | | ---------------- | | `fix(commands): bump error when no user provided` | | `feat(api): add pagination to user list endpoint` | | `docs: update installation instructions` | | `refactor(parser): simplify token extraction logic` | | ❌ Poor Examples | | ---------------- | | `fix: stuff` | | `feat: commit command introduced` | | `docs: changes` | | `refactor: code cleanup` | ``` -------------------------------- ### Example Python version file Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Shows a `src/__version__.py` file containing the version string. ```python __version__ = "1.21.0" ``` -------------------------------- ### Project-Specific Installation using pdm Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Adds Commitizen to a Python project using pdm. ```bash pdm add -d commitizen ``` -------------------------------- ### Project-Specific Installation using pip Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Adds Commitizen to a Python project using pip. ```bash pip install -U commitizen ``` -------------------------------- ### pyproject.toml Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/option.md Example of configuring Commitizen with `name` and `use_shortcuts` in a pyproject.toml file. ```toml [tool.commitizen] name = "cz_conventional_commits" use_shortcuts = true ``` -------------------------------- ### PEP 440 Pre-releases Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Examples of pre-release versions according to PEP 440. ```text 1.0.0a0 # Alpha release 0 1.0.0a1 # Alpha release 1 1.0.0b0 # Beta release 0 1.0.0rc0 # Release candidate 0 1.0.0rc1 # Release candidate 1 ``` -------------------------------- ### Use `--allowed-prefixes` Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/check.md Example of using `--allowed-prefixes` to skip validation for commit messages that start with specified prefixes. ```bash cz check --message --allowed-prefixes 'Merge' 'Revert' 'Custom Prefix' ``` ```bash # The following message passes the check because it starts with 'Merge' cz check --message "Merge branch 'main' into feature/new-feature" --allowed-prefixes 'Merge' # The following fails cz check --message "Merge branch 'main' into feature/new-feature" --allowed-prefixes 'aaa' ``` -------------------------------- ### Use `--allow-abort` Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/check.md Example of using `--allow-abort` with `--message`. ```bash cz check --message --allow-abort ``` -------------------------------- ### Validate all git commit messages starting from when you first implemented commit message linting Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/check.md Example of validating all git commit messages from a specific commit SHA. ```bash cz check --rev-range ..HEAD ``` -------------------------------- ### Example setup.py file with incorrect version Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/commands/bump.md Demonstrates a `setup.py` file with a version string that is inconsistent with the configuration. ```python from setuptools import setup setup(..., version="1.0.5", ...) ``` -------------------------------- ### cz init Command Usage Source: https://github.com/commitizen-tools/commitizen/blob/master/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_11_init_.txt Shows the usage and available options for the 'cz init' command. ```bash usage: cz init [-h] Initialize commitizen configuration options: -h, --help show this help message and exit ``` -------------------------------- ### Specify Configuration File Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/configuration_file.md Example of how to explicitly specify a configuration file using the --config option. ```bash cz --config ``` -------------------------------- ### Registering Custom Provider in setup.py Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/version_provider.md Python code for registering a custom Commitizen provider as an entry point using setup.py. ```python from setuptools import setup setup( name="my-commitizen-provider", version="0.1.0", py_modules=["my_provider"], install_requires=["commitizen"], entry_points={ "commitizen.provider": [ "my-provider = my_provider:MyProvider", ] }, ) ``` -------------------------------- ### cz init command usage Source: https://github.com/commitizen-tools/commitizen/blob/master/tests/commands/test_common_command/test_command_shows_description_when_use_help_option_py_3_10_init_.txt Shows the usage and options for the 'cz init' command when the help option is used. ```bash usage: cz init [-h] Initialize commitizen configuration options: -h, --help show this help message and exit ``` -------------------------------- ### Install cz-emoji Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-emoji.md Installation command for the cz-emoji plugin using pip. ```shell pip install cz-emoji ``` -------------------------------- ### Install cz-ai Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/cz-ai.md Command to install the cz-ai plugin using pip. ```shell pip install cz-ai ``` -------------------------------- ### Install commitizen-emoji Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/third-party-plugins/commitizen-emoji.md Command to install the commitizen-emoji plugin using pip. ```sh pip install commitizen-emoji ``` -------------------------------- ### Imperative Mood Examples Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/tutorials/writing_commits.md Examples of commit messages written in the imperative mood. ```markdown feat: add user authentication fix: resolve memory leak in parser ``` -------------------------------- ### Example Version File Update Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/config/bump.md Demonstrates how Commitizen updates a version in a JSON file based on the `version_files` configuration. ```json { "name": "magictool", "version": "1.2.3", "dependencies": { "lodash": "1.2.3" } } ``` -------------------------------- ### Install Git Hooks Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/tutorials/auto_prepare_commit_message.md Commands to download and make the prepare-commit-msg and post-commit Git hooks executable. ```bash wget -O .git/hooks/prepare-commit-msg https://raw.githubusercontent.com/commitizen-tools/commitizen/master/hooks/prepare-commit-msg.py chmod +x .git/hooks/prepare-commit-msg wget -O .git/hooks/post-commit https://raw.githubusercontent.com/commitizen-tools/commitizen/master/hooks/post-commit.py chmod +x .git/hooks/post-commit ``` -------------------------------- ### Check documentation Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/contributing/contributing.md Build documentation and check for warnings or errors. ```bash uv run poe doc ``` -------------------------------- ### Smart Commit Example - Comment Source: https://github.com/commitizen-tools/commitizen/blob/master/commitizen/cz/jira/jira_info.txt Example of a Smart Commit message to add a comment to a Jira issue. ```text JRA-34 #comment corrected indent issue ``` -------------------------------- ### Get Project Version Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/README.md Command to get the project's version, useful for automation scripts and CI/CD pipelines. ```sh # Get your project's version (instead of Commitizen's version) cz version -p # Preview changelog changes cz changelog --dry-run "$(cz version -p)" ``` -------------------------------- ### Run the full test suite Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/contributing/contributing.md Execute all tests to ensure code quality. ```bash uv run poe all ``` -------------------------------- ### pyproject.toml example with custom shortcut keys Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/customization/config_file.md This TOML snippet demonstrates how to configure Commitizen with custom shortcut keys for list and select type questions within the `cz_customize` settings. ```toml [tool.commitizen] name = "cz_customize" use_shortcuts = true [tool.commitizen.customize] message_template = "{{prefix}}: {{message}}" schema = ": " schema_pattern = "(feat|fix|docs|test):(\s.*)" [[tool.commitizen.customize.questions]] type = "list" name = "prefix" message = "Select the type of change you are committing" choices = [ { value = "feat", name = "feat: A new feature.", key = "f" }, { value = "fix", name = "fix: A bug fix.", key = "x" }, { value = "docs", name = "docs: Documentation only changes", key = "d" }, { value = "test", name = "test: Adding or correcting tests", key = "t" } ] [[tool.commitizen.customize.questions]] type = "input" name = "message" message = "Commit body: " ``` -------------------------------- ### CI/CD Pipeline Example Source: https://github.com/commitizen-tools/commitizen/blob/master/docs/exit_codes.md Example of using --no-raise in a GitHub Actions workflow to prevent pipeline failure when no version bump is needed. ```yaml # .github/workflows/release.yml - name: Bump version run: | cz -nr NO_INCREMENT bump || true # Continue even if no version bump is needed ``` -------------------------------- ### Smart Commit Example - Workflow Transition Source: https://github.com/commitizen-tools/commitizen/blob/master/commitizen/cz/jira/jira_info.txt Example of a Smart Commit message to transition a Jira issue to a specific workflow state. ```text JRA-090 #close Fixed this today ```