Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 176 additions & 176 deletions docs/config/configuration_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,182 +48,182 @@ All formats support the same configuration options. Choose the format that best

## Configuration Structure

### TOML Format

For TOML files, Commitizen settings are placed under the `[tool.commitizen]` section. If you're using a standalone `.cz.toml` or `cz.toml` file, you can use `[tool.commitizen]` or just `[commitizen]`.

**Example: `pyproject.toml`, `.cz.toml` or `cz.toml`**

```toml title="pyproject.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"]
]
```

### JSON Format

For JSON files, Commitizen settings are placed under the `commitizen` key.

**Example: `.cz.json` or `cz.json`**

```json title=".cz.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"]
=== "TOML Format"

For TOML files, Commitizen settings are placed under the `[tool.commitizen]` section. If you're using a standalone `.cz.toml` or `cz.toml` file, you can use `[tool.commitizen]` or just `[commitizen]`.

**Example: `pyproject.toml`, `.cz.toml` or `cz.toml`**

```toml title="pyproject.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"]
]
}
}
```

### YAML Format

For YAML files, Commitizen settings are placed under the `commitizen` key.

**Example: `.cz.yaml` or `cz.yaml`**

```yaml title=".cz.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
```
```

=== "JSON Format"

For JSON files, Commitizen settings are placed under the `commitizen` key.

**Example: `.cz.json` or `cz.json`**

```json title=".cz.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"]
]
}
}
```

=== "YAML Format"

For YAML files, Commitizen settings are placed under the `commitizen` key.

**Example: `.cz.yaml` or `cz.yaml`**

```yaml title=".cz.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
```

## Configuration Options

Expand All @@ -244,4 +244,4 @@ Key configuration categories include:
For advanced customization, including creating custom commit rules, see the [Customization](../customization/config_file.md) documentation.

!!! note
The `customize` option is only supported when using TOML configuration files.
The `customize` option is supported in TOML, JSON, and YAML configuration files. For Python projects, adding it to `pyproject.toml` keeps all project configuration in one place.
18 changes: 16 additions & 2 deletions docs/config/option.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Style for the prompts (It will merge this value with default style.) See [Stylin
- Type: `dict`
- Default: `None`

**This is only supported when config through `toml` configuration file.**
**Supported in TOML, JSON, and YAML configuration files.**

Custom rules for committing and bumping. See [customization](../customization/config_file.md) for more details.

Expand All @@ -35,4 +35,18 @@ Custom rules for committing and bumping. See [customization](../customization/co
- Type: `bool`
- Default: `False`

Show keyboard shortcuts when selecting from a list. Define a `key` for each of your choices to set the key. See [shortcut keys](../customization/config_file.md#shortcut-keys) for more details.
Show keyboard shortcuts when selecting from a list. When enabled, each choice shows a shortcut key; press that key or use the arrow keys to select.

Example:

```toml title="pyproject.toml"
[tool.commitizen]
name = "cz_conventional_commits"
use_shortcuts = true
```

Run `cz commit` to see shortcut keys on each choice.

![Menu with shortcut keys](../images/cli_interactive/shortcut_default.gif)

To customize which key is used for each choice (via the `key` field when using `cz_customize`), see [shortcut keys customization](../customization/config_file.md#shortcut-keys).
Loading
Loading