You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Dev and pre | `1.0.0a3.dev1` | `1.0.0-a3-dev1` |
67
-
68
-
69
-
!!! note "Incomplete Version Handling"
70
-
Commitizen treats a three-part version (major.minor.patch) as complete.
71
-
If your configured version is incomplete (for example, `1` or `1.2`), Commitizen pads missing parts with zeros when it needs `major/minor/patch` for tag formatting.
72
-
The tag output depends on your `tag_format`: formats using `${version}` keep `1`/`1.2`, while formats using `${major}.${minor}.${patch}` will render `1.0.0`/`1.2.0`.
73
-
74
-
When bumping from an incomplete version, Commitizen looks for the latest existing tag that matches the provided release prefix.
75
-
For example, if the current version is `1.2` and the latest `1.2.x` tag is `1.2.3`, then a patch bump yields `1.2.4` and a minor bump yields `1.3.0`.
76
-
77
-
!!! tip
78
-
To control the behaviour of bumping and version parsing, you may implement your own `version_scheme` by inheriting from `commitizen.version_schemes.BaseVersion` or use an existing plugin package.
79
-
80
-
81
-
### PEP440 Version Examples
82
-
83
-
Commitizen supports the [PEP 440][pep440] version format, which includes several version types. Here are examples of each:
84
-
85
-
#### Standard Releases
86
-
```text
87
-
0.9.0 # Initial development release
88
-
0.9.1 # Patch release
89
-
0.9.2 # Another patch release
90
-
0.9.10 # Tenth patch release
91
-
0.9.11 # Eleventh patch release
92
-
1.0.0 # First stable release
93
-
1.0.1 # Patch release after stable
94
-
1.1.0 # Minor feature release
95
-
2.0.0 # Major version release
96
-
```
97
-
98
-
#### Pre-releases
99
-
```text
100
-
1.0.0a0 # Alpha release 0
101
-
1.0.0a1 # Alpha release 1
102
-
1.0.0b0 # Beta release 0
103
-
1.0.0rc0 # Release candidate 0
104
-
1.0.0rc1 # Release candidate 1
105
-
```
106
-
107
-
#### Development Releases
108
-
```text
109
-
1.0.0.dev0 # Development release 0
110
-
1.0.0.dev1 # Development release 1
111
-
```
112
-
113
-
#### Combined Pre-release and Development
114
-
```text
115
-
1.0.0a1.dev0 # Development release 0 of alpha 1
116
-
1.0.0b2.dev1 # Development release 1 of beta 2
117
-
```
118
-
119
-
> **Note**: `post` releases (e.g., `1.0.0.post1`) are not currently supported.
| Dev and pre | `1.0.0a3.dev1` | `1.0.0-a3-dev1` |
476
+
477
+
478
+
!!! note "Incomplete Version Handling"
479
+
Commitizen treats a three-part version (major.minor.patch) as complete.
480
+
If your configured version is incomplete (for example, `1` or `1.2`), Commitizen pads missing parts with zeros when it needs `major/minor/patch` for tag formatting.
481
+
The tag output depends on your `tag_format`: formats using `${version}` keep `1`/`1.2`, while formats using `${major}.${minor}.${patch}` will render `1.0.0`/`1.2.0`.
482
+
483
+
When bumping from an incomplete version, Commitizen looks for the latest existing tag that matches the provided release prefix.
484
+
For example, if the current version is `1.2` and the latest `1.2.x` tag is `1.2.3`, then a patch bump yields `1.2.4` and a minor bump yields `1.3.0`.
485
+
486
+
!!! tip
487
+
To control the behaviour of bumping and version parsing, you may implement your own `version_scheme` by inheriting from `commitizen.version_schemes.BaseVersion` or use an existing plugin package.
488
+
489
+
490
+
### PEP440 Version Examples
491
+
492
+
Commitizen supports the [PEP 440][pep440] version format, which includes several version types. Here are examples of each:
493
+
494
+
#### Standard Releases
495
+
496
+
```text
497
+
0.9.0 # Initial development release
498
+
0.9.1 # Patch release
499
+
0.9.2 # Another patch release
500
+
0.9.10 # Tenth patch release
501
+
0.9.11 # Eleventh patch release
502
+
1.0.0 # First stable release
503
+
1.0.1 # Patch release after stable
504
+
1.1.0 # Minor feature release
505
+
2.0.0 # Major version release
506
+
```
507
+
508
+
#### Pre-releases
509
+
510
+
```text
511
+
1.0.0a0 # Alpha release 0
512
+
1.0.0a1 # Alpha release 1
513
+
1.0.0b0 # Beta release 0
514
+
1.0.0rc0 # Release candidate 0
515
+
1.0.0rc1 # Release candidate 1
516
+
```
517
+
518
+
#### Development Releases
519
+
520
+
```text
521
+
1.0.0.dev0 # Development release 0
522
+
1.0.0.dev1 # Development release 1
523
+
```
524
+
525
+
#### Combined Pre-release and Development
526
+
527
+
```text
528
+
1.0.0a1.dev0 # Development release 0 of alpha 1
529
+
1.0.0b2.dev1 # Development release 1 of beta 2
530
+
```
531
+
532
+
> **Note**: `post` releases (e.g., `1.0.0.post1`) are not currently supported.
This value can be set in the configuration file with the key `changelog_start_rev` under `tool.commitizen`
111
-
112
118
Start from a given git rev to generate the changelog. Commits before that rev will not be considered. This is especially useful for long-running projects adopting conventional commits, where old commit messages might fail to be parsed for changelog generation.
113
119
114
120
```bash
115
121
cz changelog --start-rev="v0.2.0"
116
122
```
117
123
124
+
This value can be set in the configuration file with the key `changelog_start_rev` under `tool.commitizen`
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tool.commitizen`
127
-
128
134
Collects changes from prereleases into the next non-prerelease version. If you have a prerelease version followed by a normal release, the changelog will show the prerelease changes as part of the normal release. If not set, prereleases will be included as separate entries in the changelog.
129
135
130
136
```bash
131
137
cz changelog --merge-prerelease
132
138
```
133
139
140
+
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tool.commitizen`
Copy file name to clipboardExpand all lines: docs/config/bump.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,47 @@ version_files = [
212
212
!!! note "Historical note"
213
213
This option was renamed from `files` to `version_files`.
214
214
215
+
## `version_provider`
216
+
217
+
Mechanism by which Commitizen reads and writes version information in your project.
218
+
219
+
For a detailed explanation, check the [version provider](./version_provider.md) section.
220
+
Which includes, how to create your own version provider.
221
+
222
+
**Available options**
223
+
224
+
-`commitizen`: default version provider and stores the version in the active commitizen config (`pyproject.toml` or `.cz.toml`) under the key `version`
225
+
-`scm`: git tags provide the real version to commitizen (read only)
226
+
-`pep621`: (python) manages version in `pyproject.toml` under the `project.version` field, following [PEP 621](https://peps.python.org/pep-0621/) standards
227
+
-`poetry`: takes the version from poetry v1, use `pep621` with poetry v2 or later
228
+
-`uv`: same as `pep621` except that it also updates the `uv.lock`
229
+
-`cargo`: manages version in both `Cargo.toml` (`package.version`) and `Cargo.lock`
230
+
-`npm`: manages version in `package.json` and the lock
231
+
-`composer`: for PHP's Composer package manager
232
+
233
+
**Example**
234
+
235
+
```toml
236
+
[tool.commitizen]
237
+
version_provider = "pep621"
238
+
```
239
+
215
240
## `version_scheme`
216
241
217
-
See [`--version-scheme`](../commands/bump.md#-version-scheme).
242
+
Format used for the version.
243
+
244
+
For a detail explanation, check [`--version-scheme`](../commands/bump.md#-version-scheme).
-`cz_customize`: (**not recommended**) customize the convention directly in the `TOML` file under `[tool.commitizen.customize]`, read [Customize in configuration file](../customization/config_file.md) for more. There's a plan to provide a different functionality.
7
13
8
-
Name of the committing rules to use.
14
+
You can write your own convention, and release it on PyPI, check [Customizing through a Python class](../customization/python_class.md).
9
15
10
16
## `version`
11
17
18
+
Current version.
19
+
20
+
Required if you use `version_provider = "commitizen"`.
21
+
12
22
- Type: `str`
13
23
- Default: `None`
14
24
15
-
Current version. Example: `"0.1.2"`. Required if you use `version_provider = "commitizen"`.
25
+
Example: `"0.1.2"`.
16
26
17
27
## `style`
18
28
29
+
Style for the prompts.
30
+
19
31
- Type: `list`
20
32
- Default: `[]`
21
33
22
-
Style for the prompts (It will merge this value with default style.) See [Styling your prompts with your favorite colors](https://github.com/tmbo/questionary#additional-features) for more details.
34
+
It will merge this value with default style. See [Styling your prompts with your favorite colors](https://github.com/tmbo/questionary#additional-features) for more details.
23
35
24
36
## `customize`
25
37
38
+
Custom rules for committing and bumping.
39
+
26
40
- Type: `dict`
27
41
- Default: `None`
28
42
29
43
**Supported in TOML, JSON, and YAML configuration files.**
30
44
31
-
Custom rules for committing and bumping. See [customization](../customization/config_file.md) for more details.
45
+
See [customization](../customization/config_file.md) for more details.
32
46
33
47
## `use_shortcuts`
34
48
49
+
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.
50
+
35
51
- Type: `bool`
36
52
- Default: `False`
37
53
38
-
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.
0 commit comments