Skip to content

Commit 3323689

Browse files
committed
fix links
1 parent 289a7f0 commit 3323689

File tree

7 files changed

+122
-156
lines changed

7 files changed

+122
-156
lines changed

docs/commands/bump.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Available options are:
5050
- `pep440`: [PEP 440][pep440] (**default** and recommended for Python projects)
5151
- `semver`: [Semantic Versioning][semver] (recommended for non-Python projects)
5252

53-
You can also set this in the [configuration](#version_scheme) with `version_scheme = "semver"`.
53+
You can also set this in the configuration file with `version_scheme = "semver"`.
5454

5555
!!! note
5656
[pep440][pep440] and [semver][semver] are quite similar, although their difference lies in
@@ -111,7 +111,7 @@ Commitizen supports the [PEP 440][pep440] version format, which includes several
111111

112112
### `--files-only`
113113

114-
Bumps the version in the files defined in [`version_files`](#version_files) without creating a commit and tag on the git repository.
114+
Bumps the version in the files defined in [version_files][version_files] without creating a commit and tag on the git repository.
115115

116116
```bash
117117
cz bump --files-only
@@ -178,7 +178,7 @@ The following table illustrates the difference in behavior between the two modes
178178

179179
### `--check-consistency`
180180

181-
Check whether the versions defined in [`version_files`](#version_files) and the version in Commitizen configuration are consistent before bumping version.
181+
Check whether the versions defined in [version_files][version_files] and the version in Commitizen configuration are consistent before bumping version.
182182

183183
```bash
184184
cz bump --check-consistency
@@ -207,7 +207,7 @@ from setuptools import setup
207207
setup(..., version="1.0.5", ...)
208208
```
209209

210-
When you run `cz bump --check-consistency`, Commitizen will verify that the current version in `pyproject.toml` (`1.21.0`) exists in all files listed in [`version_files`](#version_files).
210+
When you run `cz bump --check-consistency`, Commitizen will verify that the current version in `pyproject.toml` (`1.21.0`) exists in all files listed in [version_files][version_files].
211211
In this example, it will detect that `setup.py` contains `1.0.5` instead of `1.21.0`, causing the bump to fail.
212212

213213
!!! warning "Partial updates on failure"
@@ -457,13 +457,9 @@ Allow the project version to be bumped even when there's no eligible version.
457457
cz bump --allow-no-commit
458458
```
459459

460-
### `--version-scheme`
461-
462-
See [Version Schemes](#version-schemes-version-scheme).
463-
464460
### `--tag-format`
465461

466-
`tag_format` and [`version_scheme`](#version-schemes-version-scheme) are combined to make Git tag names from versions.
462+
`tag_format` and [version_scheme][version_scheme] are combined to make Git tag names from versions.
467463

468464
These are used in:
469465

@@ -505,9 +501,6 @@ Supported variables:
505501
| `$prerelease`, `${prerelease}` | Prerelease (alpha, beta, release candidate) |
506502
| `$devrelease`, `${devrelease}` | Development release |
507503

508-
509-
## Configuration file options
510-
511504
## Avoid raising errors
512505

513506
Some situations from Commitizen raise an exit code different from 0.
@@ -577,3 +570,4 @@ Read the [customizing section](../customization.md).
577570

578571
[pep440]: https://www.python.org/dev/peps/pep-0440/
579572
[semver]: https://semver.org/
573+
[version_files]: ../config/bump.md#version_files

docs/commands/changelog.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
This command will generate a changelog following the committing rules established.
44

5-
To create the changelog automatically on bump, add the setting [update_changelog_on_bump](./bump.md#update_changelog_on_bump)
5+
!!! tip
6+
To create the changelog automatically on bump, add the setting [update_changelog_on_bump](../config/bump.md#update_changelog_on_bump)
67

7-
```toml
8-
[tool.commitizen]
9-
update_changelog_on_bump = true
10-
```
8+
```toml
9+
[tool.commitizen]
10+
update_changelog_on_bump = true
11+
```
1112

1213
## Usage
1314

docs/config/bump.md

Lines changed: 102 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,15 @@
11
# Bump Options
22

3-
## `legacy_tag_formats`
4-
5-
- Type: `list`
6-
- Default: `[]`
7-
8-
Legacy git tag formats, useful for old projects that changed tag format.
9-
Tags matching those formats will be recognized as version tags and be included in the changelog.
10-
Each entry uses the syntax as `tag_format`.
11-
12-
### `version_files`
13-
14-
Identify the files or glob patterns which should be updated with the new version.
15-
16-
Commitizen will update its configuration file automatically when bumping,
17-
regardless of whether the file is present or not in `version_files`.
18-
19-
You may specify the `version_files` in your configuration file.
20-
21-
```toml title="pyproject.toml"
22-
[tool.commitizen]
23-
version_files = [
24-
"src/__version__.py",
25-
]
26-
```
27-
28-
It is also possible to provide a pattern for each file, separated by a colon (e.g. `file:pattern`). See the below example for more details.
29-
30-
```toml title="pyproject.toml"
31-
[tool.commitizen]
32-
version_files = [
33-
"packages/*/pyproject.toml:version",
34-
"setup.json:version",
35-
]
36-
```
3+
## `annotated_tag`
374

38-
#### Example scenario
39-
40-
We have a project with the following configuration file `pyproject.toml`:
5+
When set to `true`, `cz bump` is equivalent to `cz bump --annotated-tag`.
416

427
```toml title="pyproject.toml"
438
[tool.commitizen]
44-
version_files = [
45-
"src/__version__.py",
46-
"packages/*/pyproject.toml:version",
47-
"setup.json:version",
48-
]
49-
```
50-
51-
For the reference `"setup.json:version"`, it means that it will look for a file `setup.json` and will only change the lines that contain the substring `"version"`.
52-
53-
For example, if the content of `setup.json` is:
54-
55-
<!-- DEPENDENCY: repeated_version_number.json -->
56-
57-
```json title="setup.json"
58-
{
59-
"name": "magictool",
60-
"version": "1.2.3",
61-
"dependencies": {
62-
"lodash": "1.2.3"
63-
}
64-
}
65-
```
66-
67-
After running `cz bump 2.0.0`, its content will be updated to:
68-
69-
```diff title="setup.json"
70-
{
71-
"name": "magictool",
72-
- "version": "1.2.3",
73-
+ "version": "2.0.0",
74-
"dependencies": {
75-
"lodash": "1.2.3"
76-
}
77-
}
9+
annotated_tag = true
7810
```
7911

80-
!!! note
81-
Files can be specified using relative (to the execution) paths, absolute paths, or glob patterns.
82-
83-
!!! note "Historical note"
84-
This option was renamed from `files` to `version_files`.
85-
86-
### `bump_message`
12+
## `bump_message`
8713

8814
Template used to specify the commit message generated when bumping.
8915

@@ -94,53 +20,49 @@ Defaults to: `bump: version $current_version → $new_version`
9420
| `$current_version` | the version existing before bumping |
9521
| `$new_version` | version generated after bumping |
9622

97-
#### Example configuration
98-
9923
```toml title="pyproject.toml"
10024
[tool.commitizen]
10125
bump_message = "release $current_version → $new_version [skip-ci]"
10226
```
10327

104-
### `update_changelog_on_bump`
28+
## `gpg_sign`
10529

106-
When set to `true`, `cz bump` is equivalent to `cz bump --changelog`.
30+
When set to `true`, `cz bump` is equivalent to `cz bump --gpg-sign`. See [`--gpg-sign`](../commands/bump.md#-gpg-sign).
10731

10832
```toml title="pyproject.toml"
10933
[tool.commitizen]
110-
update_changelog_on_bump = true
34+
gpg_sign = true
11135
```
11236

113-
### `annotated_tag`
37+
## `ignored_tag_formats`
11438

115-
When set to `true`, `cz bump` is equivalent to `cz bump --annotated-tag`.
39+
- Type: `list`
40+
- Default: `[]`
11641

117-
```toml title="pyproject.toml"
118-
[tool.commitizen]
119-
annotated_tag = true
120-
```
42+
Tags matching those formats will be totally ignored and won't raise a warning.
43+
Each entry uses the syntax as [`tag_format`](#tag_format) with the addition of `*` that will match everything (non-greedy).
12144

122-
### `gpg_sign`
45+
## `major_version_zero`
12346

124-
When set to `true`, `cz bump` is equivalent to `cz bump --gpg-sign`. See [`--gpg-sign`](../commands/bump.md#-gpg-sign).
47+
When set to `true`, `cz bump` is equivalent to `cz bump --major-version-zero`. See [`--major-version-zero`](../commands/bump.md#-major-version-zero).
12548

12649
```toml title="pyproject.toml"
12750
[tool.commitizen]
128-
gpg_sign = true
51+
major_version_zero = true
12952
```
13053

131-
### `major_version_zero`
54+
## `legacy_tag_formats`
13255

133-
When set to `true`, `cz bump` is equivalent to `cz bump --major-version-zero`. See [`--major-version-zero`](../commands/bump.md#-major-version-zero).
56+
- Type: `list`
57+
- Default: `[]`
13458

135-
```toml title="pyproject.toml"
136-
[tool.commitizen]
137-
major_version_zero = true
138-
```
59+
Legacy git tag formats, useful for old projects that changed tag format.
60+
Tags matching those formats will be recognized as version tags and be included in the changelog.
61+
Each entry uses the syntax as `tag_format`.
13962

140-
### `pre_bump_hooks`
63+
## `pre_bump_hooks`
14164

142-
A list of optional commands that will run right _after_ updating [`version_files`](#version_files)
143-
and _before_ actual committing and tagging the release.
65+
A list of optional commands that will run right *after* updating [`version_files`](#version_files) and *before* actual committing and tagging the release.
14466

14567
Useful when you need to generate documentation based on the new version. During
14668
execution of the script, some environment variables are available:
@@ -163,9 +85,9 @@ pre_bump_hooks = [
16385
]
16486
```
16587

166-
### `post_bump_hooks`
88+
## `post_bump_hooks`
16789

168-
A list of optional commands that will run right _after_ committing and tagging the release.
90+
A list of optional commands that will run right *after* committing and tagging the release.
16991

17092
Useful when you need to send notifications about a release, or further automate deploying the
17193
release. During execution of the script, some environment variables are available:
@@ -188,56 +110,106 @@ post_bump_hooks = [
188110
]
189111
```
190112

191-
### `prerelease_offset`
113+
## `prerelease_offset`
192114

193115
Offset with which to start counting prereleases.
194116

195-
Defaults to: `0`
117+
If not specified, defaults to `0`.
196118

197119
```toml title="pyproject.toml"
198120
[tool.commitizen]
199121
prerelease_offset = 1
200122
```
201123

202-
### `version_scheme`
124+
!!! note
125+
Under some circumstances, a prerelease cannot start with `0`-for example, in embedded projects where individual characters are encoded as bytes. You can specify an offset from which to start counting.
203126

204-
See [`--version-scheme`](../commands/bump.md#--version-scheme).
127+
## `tag_format`
205128

206-
### `ignored_tag_formats`
129+
See [`--tag-format`](../commands/bump.md#-tag-format).
207130

208-
- Type: `list`
209-
- Default: `[]`
210-
211-
Tags matching those formats will be totally ignored and won't raise a warning.
212-
Each entry uses the syntax as [`tag_format`](#tag_format) with the addition of `*`
213-
that will match everything (non-greedy). [Read more][tag_format]
131+
## `update_changelog_on_bump`
214132

133+
When set to `true`, `cz bump` is equivalent to `cz bump --changelog`.
215134

216-
### `major_version_zero`
135+
```toml title="pyproject.toml"
136+
[tool.commitizen]
137+
update_changelog_on_bump = true
138+
```
217139

218-
- Type: `bool`
219-
- Default: `False`
140+
## `version_files`
220141

221-
If enabled, breaking changes on a `0.x` will remain as a `0.x` version. Otherwise, a breaking change will bump a `0.x` version to `1.0`. [Read more][major-version-zero]
142+
Identify the files or glob patterns which should be updated with the new version.
222143

144+
Commitizen will update its configuration file automatically when bumping,
145+
regardless of whether the file is present or not in `version_files`.
223146

224-
### `prerelease_offset`
147+
You may specify the `version_files` in your configuration file.
225148

226-
- Type: `int`
227-
- Default: `0`
149+
```toml title="pyproject.toml"
150+
[tool.commitizen]
151+
version_files = [
152+
"src/__version__.py",
153+
]
154+
```
228155

229-
In some circumstances, a prerelease cannot start with `0`-for example, in embedded projects where individual characters are encoded as bytes. You can specify an offset from which to start counting. [Read more][prerelease-offset]
156+
It is also possible to provide a pattern for each file, separated by a colon (e.g. `file:pattern`). See the below example for more details.
230157

231-
### `pre_bump_hooks`
158+
```toml title="pyproject.toml"
159+
[tool.commitizen]
160+
version_files = [
161+
"packages/*/pyproject.toml:version",
162+
"setup.json:version",
163+
]
164+
```
232165

233-
- Type: `list[str]`
234-
- Default: `[]`
166+
!!! note "Example scenario"
167+
We have a project with the following configuration file `pyproject.toml`:
168+
169+
```toml title="pyproject.toml"
170+
[tool.commitizen]
171+
version_files = [
172+
"src/__version__.py",
173+
"packages/*/pyproject.toml:version",
174+
"setup.json:version",
175+
]
176+
```
177+
178+
For the reference `"setup.json:version"`, it means that it will look for a file `setup.json` and will only change the lines that contain the substring `"version"`.
179+
180+
For example, if the content of `setup.json` is:
181+
182+
<!-- DEPENDENCY: repeated_version_number.json -->
183+
184+
```json title="setup.json"
185+
{
186+
"name": "magictool",
187+
"version": "1.2.3",
188+
"dependencies": {
189+
"lodash": "1.2.3"
190+
}
191+
}
192+
```
193+
194+
After running `cz bump 2.0.0`, its content will be updated to:
195+
196+
```diff title="setup.json"
197+
{
198+
"name": "magictool",
199+
- "version": "1.2.3",
200+
+ "version": "2.0.0",
201+
"dependencies": {
202+
"lodash": "1.2.3"
203+
}
204+
}
205+
```
235206

236-
Calls the hook scripts **before** bumping version. [Read more][pre_bump_hooks]
207+
!!! note
208+
Files can be specified using relative (to the execution) paths, absolute paths, or glob patterns.
237209

238-
### `post_bump_hooks`
210+
!!! note "Historical note"
211+
This option was renamed from `files` to `version_files`.
239212

240-
- Type: `list[str]`
241-
- Default: `[]`
213+
## `version_scheme`
242214

243-
Calls the hook scripts **after** bumping the version. [Read more][post_bump_hooks]
215+
See [`--version-scheme`](../commands/bump.md#-version-scheme).

0 commit comments

Comments
 (0)