2
2
3
3
## About
4
4
5
- The version is bumped ** automatically** based on the commits.
5
+ ` cz bump ` ** automatically** increases the version, based on the commits.
6
6
7
- The commits should follow the rules of the committer to be parsed correctly.
7
+ The commits should follow the rules established by the committer in order to be parsed correctly.
8
8
9
- It is possible to specify a ** prerelease** (alpha, beta, release candidate) version .
9
+ ** prerelease** versions are supported (alpha, beta, release candidate).
10
10
11
11
The version can also be ** manually** bumped.
12
12
13
- The version format follows [ semantic versioning] [ semver ] .
13
+ The version format follows [ PEP 0440 ] [ pep440 ] and [ semantic versioning] [ semver ] .
14
14
15
15
This means ` MAJOR.MINOR.PATCH `
16
16
@@ -20,15 +20,13 @@ This means `MAJOR.MINOR.PATCH`
20
20
| ` MINOR ` | New features | ` feat ` |
21
21
| ` PATCH ` | Fixes | ` fix ` + everything else |
22
22
23
- Prereleases are supported following python's [ PEP 0440] [ pep440 ]
23
+ [ PEP 0440] [ pep440 ] is the default, you can switch by using the setting ` version_type ` or the cli:
24
24
25
- The scheme of this format is
26
-
27
- ``` bash
28
- [N! ]N(.N)* [{a| b| rc}N][.postN][.devN]
25
+ ``` sh
26
+ cz bump --version-type semver
29
27
```
30
28
31
- Some examples:
29
+ Some examples of pep440 :
32
30
33
31
``` bash
34
32
0.9.0
@@ -217,12 +215,38 @@ We recommend setting `major_version_zero = true` in your configuration file whil
217
215
is in its initial development. Remove that configuration using a breaking-change commit to bump
218
216
your project’s major version to `v1.0.0` once your project has reached maturity.
219
217
218
+ ### `--version-type`
219
+
220
+ Choose the version format, options: `pep440`, `semver`.
221
+
222
+ Default: `pep440`
223
+
224
+ Recommended for python: `pep440`
225
+
226
+ Recommended for other: `semver`
227
+
228
+ You can also set this in the [configuration](#version_type) with `version_type = "semver"`.
229
+
230
+ [pep440][pep440] and [semver][semver] are quite similar, their difference lies in
231
+ how the prereleases look.
232
+
233
+ | types | pep440 | semver |
234
+ | -------------- | -------------- | --------------- |
235
+ | non-prerelease | `0.1.0` | `0.1.0` |
236
+ | prerelease | `0.3.1a0` | `0.3.1-a0` |
237
+ | devrelease | `0.1.1.dev1` | `0.1.1-dev1` |
238
+ | dev and pre | `1.0.0a3.dev1` | `1.0.0-a3-dev1` |
239
+
240
+ Can I transition from one to the other?
241
+
242
+ Yes, you shouldn' t have any issues.
243
+
220
244
# # Avoid raising errors
221
245
222
- Some situations from commitizen rise an exit code different than 0.
246
+ Some situations from commitizen raise an exit code different than 0.
223
247
If the error code is different than 0, any CI or script running commitizen might be interrupted.
224
248
225
- If you have special use case, where you don' t want one of this error codes to be raised , you can
249
+ If you have a special use case, where you don' t want to raise one of this error codes, you can
226
250
tell commitizen to not raise them.
227
251
228
252
### Recommended use case
@@ -463,7 +487,7 @@ release. During execution of the script, some environment variables are availabl
463
487
| `CZ_POST_INCREMENT` | Whether this wass a `MAJOR`, `MINOR` or `PATH` release |
464
488
| `CZ_POST_CHANGELOG_FILE_NAME` | Path to the changelog file, if available |
465
489
466
- ` ` ` toml
490
+ ```` toml
467
491
[tool.commitizen]
468
492
post_bump_hooks = [
469
493
"scripts/slack_notification.sh"
@@ -477,20 +501,20 @@ Defaults to: `0`
477
501
```toml
478
502
[tool.commitizen]
479
503
prerelease_offset = 1
480
- ` ` `
504
+ ````
481
505
482
506
### `version_type`
483
507
484
508
Choose version type
485
509
486
- * ` pep440` - default version type.
487
- - prerelease - ` 1.0.1a0 `
488
- - devrelease - ` 1.0.1dev0 `
489
- - dev and pre - ` 1.0.1a0.dev0 `
490
- * ` semver ` - semver compatibly type. Added " - " delimiter
491
- - prerelease - ` 1.0.1-a0 `
492
- - devrelease - ` 1.0.1-dev0 `
493
- - dev and pre - ` 1.0.1-a0-dev0 `
510
+ | types | pep440 | semver |
511
+ | -------------- | -------------- | --------------- |
512
+ | non-prerelease | `0.1.0` | `0. 1.0` |
513
+ | prerelease | `0.3.1a0` | `0.3.1-a0` |
514
+ | devrelease | `0.1.1.dev1` | `0.1.1-dev1` |
515
+ | dev and pre | `1.0.0a3.dev1` | `1.0.0-a3-dev1` |
516
+
517
+ Options: `sever`, `pep440 `
494
518
495
519
Defaults to: `pep440`
496
520
0 commit comments