Skip to content

Commit b0235e5

Browse files
committed
docs(changelog): fix minor mistakes in changelog documentation, improve fluency
1 parent aa82b98 commit b0235e5

File tree

1 file changed

+37
-38
lines changed

1 file changed

+37
-38
lines changed

docs/commands/changelog.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## About
22

3-
This command will generate a changelog following the committing rules established.
3+
Generates a changelog following the committing rules established.
44

55
!!! tip
66
To create the changelog automatically on bump, add the setting [update_changelog_on_bump](../config/bump.md#update_changelog_on_bump)
@@ -20,7 +20,7 @@ This command will generate a changelog following the committing rules establishe
2020
# Generate full changelog
2121
cz changelog
2222

23-
# or use the alias
23+
# Or use the alias
2424
cz ch
2525

2626
# Get the changelog for the given version
@@ -30,7 +30,7 @@ cz changelog 0.3.0 --dry-run
3030
cz changelog 0.3.0..0.4.0 --dry-run
3131
```
3232

33-
## Constrains
33+
## Constraints
3434

3535
Changelog generation is constrained only to **markdown** files.
3636

@@ -46,68 +46,68 @@ These are the variables used by the changelog generator.
4646
- **<scope>**: <message>
4747
```
4848

49-
It will create a full block like above per version found in the tags.
50-
And it will create a list of the commits found.
51-
The `change_type` and the `scope` are optional, they don't need to be provided,
52-
but if your regex does, they will be rendered.
49+
Creates a full block like above per version found in the tags, and a list of the commits found.
50+
The `change_type` and `scope` are optional and don't need to be provided,
51+
but if your regex parses them, they will be rendered.
5352

54-
The format followed by the changelog is the one from [keep a changelog][keepachangelog]
53+
The format followed by the changelog is from [keep a changelog][keepachangelog]
5554
and the following variables are expected:
5655

5756
| Variable | Description | Source |
5857
| ------------- | ---------------------------------------------------------------------------------------------- | -------------- |
5958
| `version` | Version number which should follow [semver][semver] | `tags` |
60-
| `date` | Date in which the tag was created | `tags` |
59+
| `date` | Date when the tag was created | `tags` |
6160
| `change_type` | The group where the commit belongs to, this is optional. Example: fix | `commit regex` |
62-
| `message`\* | Information extracted from the commit message | `commit regex` |
61+
| `message` | Information extracted from the commit message | `commit regex` |
6362
| `scope` | Contextual information. Should be parsed using the regex from the message, it will be **bold** | `commit regex` |
64-
| `breaking` | Whether is a breaking change or not | `commit regex` |
63+
| `breaking` | Whether it is a breaking change or not | `commit regex` |
6564

66-
- **required**: is the only one required to be parsed by the regex
65+
!!! note
66+
`message` is the only variable required to be parsed by the regex.
6767

6868
## Command line options
6969

7070
### `--extras`
7171

72-
Provides your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
72+
Provide your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
7373

7474
```bash
7575
cz changelog --extra key=value -e short="quoted value"
7676
```
7777

7878
### `--file-name`
7979

80-
This value can be updated in the configuration file with the key `changelog_file` under `tools.commitizen`
80+
This value can be updated in the configuration file with the key `changelog_file` under `tool.commitizen`.
8181

82-
Specify the name of the output file, remember that changelog only works with Markdown.
82+
Specify the name of the output file. Note that changelog generation only works with Markdown files.
8383

8484
```bash
8585
cz changelog --file-name="CHANGES.md"
8686
```
8787

8888
### `--incremental`
8989

90-
This flag can be set in the configuration file with the key `changelog_incremental` under `tools.commitizen`
90+
This flag can be set in the configuration file with the key `changelog_incremental` under `tool.commitizen`
9191

9292
Benefits:
9393

94-
- Build from the latest version found in changelog, this is useful if you have a different changelog and want to use commitizen
94+
- Build from the latest version found in changelog. This is useful if you have an existing changelog and want to use commitizen to extend it.
9595
- Update unreleased area
96-
- Allows users to manually touch the changelog without being rewritten.
96+
- Allows users to manually edit the changelog without it being completely rewritten.
9797

9898
```bash
9999
cz changelog --incremental
100100
```
101101

102102
```toml
103-
[tools.commitizen]
103+
[tool.commitizen]
104104
# ...
105105
changelog_incremental = true
106106
```
107107

108108
### `--start-rev`
109109

110-
This value can be set in the configuration file with the key `changelog_start_rev` under `tools.commitizen`
110+
This value can be set in the configuration file with the key `changelog_start_rev` under `tool.commitizen`
111111

112112
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.
113113

@@ -116,56 +116,55 @@ cz changelog --start-rev="v0.2.0"
116116
```
117117

118118
```toml
119-
[tools.commitizen]
119+
[tool.commitizen]
120120
# ...
121121
changelog_start_rev = "v0.2.0"
122122
```
123123

124124
### `--merge-prerelease`
125125

126-
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tools.commitizen`
126+
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tool.commitizen`
127127

128-
Collects changes from prereleases into the next non-prerelease. This means that if you have a prerelease version, and then a normal release, the changelog will show the prerelease changes as part of the changes of the normal release. If not set, it will include prereleases in the changelog.
128+
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.
129129

130130
```bash
131131
cz changelog --merge-prerelease
132132
```
133133

134134
```toml
135-
[tools.commitizen]
135+
[tool.commitizen]
136136
# ...
137137
changelog_merge_prerelease = true
138138
```
139139

140140
### `--template`
141141

142-
Provides your own changelog jinja template by using the `template` settings or the `--template` parameter.
142+
Provide your own changelog Jinja template by using the `template` settings or the `--template` parameter.
143+
144+
```bash
145+
cz changelog --template="path/to/template.j2"
146+
```
143147

144148
### `--unreleased-version`
145149

146-
There is usually a chicken and egg situation when automatically
147-
bumping the version and creating the changelog.
148-
If you bump the version first, you have no changelog, you have to
149-
create it later, and it won't be included in
150-
the release of the created version.
150+
There is usually a chicken-and-egg situation when automatically bumping the version and creating the changelog:
151151

152-
If you create the changelog before bumping the version, then you
153-
usually don't have the latest tag, and the _Unreleased_ title appears.
152+
- If you bump the version first, you have no changelog yet, and it won't be included in the release of the created version.
153+
- If you create the changelog before bumping the version, you usually don't have the latest tag, and the _Unreleased_ title appears.
154154

155-
By introducing `--unreleased-version` you can prevent this situation.
155+
By using `--unreleased-version`, you can prevent this situation.
156156

157157
Before bumping you can run:
158158

159159
```bash
160160
cz changelog --unreleased-version="v1.0.0"
161161
```
162162

163-
Remember to use the tag instead of the raw version number
163+
Remember to use the tag format instead of the raw version number.
164164

165-
For example if the format of your tag includes a `v` (`v1.0.0`), then you should use that,
166-
if your tag is the same as the raw version, then ignore this.
165+
For example, if your tag format includes a `v` prefix (e.g., `v1.0.0`), use that format. If your tag is the same as the raw version (e.g., `1.0.0`), use the raw version.
167166

168-
Alternatively you can directly bump the version and create the changelog by doing
167+
Alternatively, you can directly bump the version and create the changelog by running:
169168

170169
```bash
171170
cz bump --changelog
@@ -175,7 +174,7 @@ cz bump --changelog
175174

176175
Supported hook methods:
177176

178-
- Per parsed message: Useful to add links
177+
- Per parsed message: Useful to add links to commits or issues
179178
- End of changelog generation: Useful to send Slack or chat messages, or notify another department
180179

181180
Read more about hooks in the [customization page][customization]

0 commit comments

Comments
 (0)