Skip to content

Commit 3c4f9cc

Browse files
committed
docs(bump): improve description of bumping
1 parent 51640fd commit 3c4f9cc

File tree

1 file changed

+46
-22
lines changed

1 file changed

+46
-22
lines changed

docs/bump.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## About
44

5-
The version is bumped **automatically** based on the commits.
5+
`cz bump` **automatically** increases the version, based on the commits.
66

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.
88

9-
It is possible to specify a **prerelease** (alpha, beta, release candidate) version.
9+
**prerelease** versions are supported (alpha, beta, release candidate).
1010

1111
The version can also be **manually** bumped.
1212

13-
The version format follows [semantic versioning][semver].
13+
The version format follows [PEP 0440][pep440] and [semantic versioning][semver].
1414

1515
This means `MAJOR.MINOR.PATCH`
1616

@@ -20,15 +20,13 @@ This means `MAJOR.MINOR.PATCH`
2020
| `MINOR` | New features | `feat` |
2121
| `PATCH` | Fixes | `fix` + everything else |
2222

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:
2424

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
2927
```
3028

31-
Some examples:
29+
Some examples of pep440:
3230

3331
```bash
3432
0.9.0
@@ -217,12 +215,38 @@ We recommend setting `major_version_zero = true` in your configuration file whil
217215
is in its initial development. Remove that configuration using a breaking-change commit to bump
218216
your project’s major version to `v1.0.0` once your project has reached maturity.
219217
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+
220244
## Avoid raising errors
221245
222-
Some situations from commitizen rise an exit code different than 0.
246+
Some situations from commitizen raise an exit code different than 0.
223247
If the error code is different than 0, any CI or script running commitizen might be interrupted.
224248
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
226250
tell commitizen to not raise them.
227251
228252
### Recommended use case
@@ -463,7 +487,7 @@ release. During execution of the script, some environment variables are availabl
463487
| `CZ_POST_INCREMENT` | Whether this wass a `MAJOR`, `MINOR` or `PATH` release |
464488
| `CZ_POST_CHANGELOG_FILE_NAME` | Path to the changelog file, if available |
465489
466-
```toml
490+
````toml
467491
[tool.commitizen]
468492
post_bump_hooks = [
469493
"scripts/slack_notification.sh"
@@ -477,20 +501,20 @@ Defaults to: `0`
477501
```toml
478502
[tool.commitizen]
479503
prerelease_offset = 1
480-
```
504+
````
481505
482506
### `version_type`
483507
484508
Choose version type
485509
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`
494518
495519
Defaults to: `pep440`
496520

0 commit comments

Comments
 (0)