Skip to content

Commit 2c117b3

Browse files
Merge branch 'master' into docs-faq
2 parents fd43e54 + b565e4b commit 2c117b3

21 files changed

+350
-249
lines changed

.github/workflows/bumpversion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: "Bump version and create changelog with commitizen"
1313
steps:
1414
- name: Check out
15-
uses: actions/checkout@v5
15+
uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
1818
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"

.github/workflows/docspublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
update-cli-screenshots:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v6
1414
with:
1515
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
1616
fetch-depth: 0
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: ubuntu-latest
4444
needs: update-cli-screenshots
4545
steps:
46-
- uses: actions/checkout@v5
46+
- uses: actions/checkout@v6
4747
with:
4848
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
4949
fetch-depth: 0

.github/workflows/homebrewpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v5
15+
uses: actions/checkout@v6
1616
- name: Set up Python
1717
uses: actions/setup-python@v6
1818
with:
@@ -24,7 +24,7 @@ jobs:
2424
run: |
2525
echo "project_version=$(cz version --project)" >> $GITHUB_ENV
2626
- name: Update Homebrew formula
27-
uses: dawidd6/action-homebrew-bump-formula@v5
27+
uses: dawidd6/action-homebrew-bump-formula@v6
2828
with:
2929
token: ${{secrets.PERSONAL_ACCESS_TOKEN}}
3030
formula: commitizen

.github/workflows/label_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
pull-requests: write
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
1313
with:
1414
sparse-checkout: |
1515
.github/labeler.yml

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
platform: [ubuntu-22.04, macos-latest, windows-latest]
1111
runs-on: ${{ matrix.platform }}
1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v6
1414
with:
1515
fetch-depth: 0
1616
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/pythonpublish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
1313
with:
1414
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
1515
fetch-depth: 0

docs/commands/bump.md

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -128,7 +128,7 @@ cz bump --changelog
128128
### `--prerelease`
129129

130130
The bump is a pre-release bump, meaning that in addition to a possible version bump the new version receives a
131-
pre-release segment compatible with the bumps version scheme, where the segment consist of a _phase_ and a
131+
pre-release segment compatible with the bump's version scheme, where the segment consists of a _phase_ and a
132132
non-negative number. Supported options for `--prerelease` are the following phase names `alpha`, `beta`, or
133133
`rc` (release candidate). For more details, refer to the
134134
[Python Packaging User Guide](https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases).
@@ -222,10 +222,11 @@ In this example, it will detect that `setup.py` contains `1.0.5` instead of `1.2
222222
```
223223

224224
2. Manually update the version in `setup.py` to match the version in `pyproject.toml`:
225-
```python title="setup.py"
225+
```diff title="setup.py"
226226
from setuptools import setup
227227

228-
setup(..., version="1.21.0", ...)
228+
- setup(..., version="1.0.5", ...)
229+
+ setup(..., version="1.21.0", ...)
229230
```
230231

231232
3. Run the bump command again:
@@ -280,19 +281,20 @@ Any other messages generated by `cz bump` will be sent to `stderr`.
280281
When this flag is used, `--changelog` is implied.
281282
However, it is recommended to set `--changelog` (or the setting `update_changelog_on_bump`) explicitly when the option `--changelog-to-stdout` is used.
282283

283-
#### Useful scenarios
284+
!!! note "Useful scenarios"
285+
Pipe the newly created changelog to another tool.
284286

285-
This is useful to pipe the newly created changelog to another tool. For example, it can be sent to an auditing system, or to create a GitHub Release, etc.
287+
The output can be redirected to an auditing system, or used to create a GitHub Release, etc.
286288

287-
```bash
288-
cz bump --changelog --changelog-to-stdout > body.md
289-
```
289+
```bash
290+
cz bump --changelog --changelog-to-stdout > body.md
291+
```
290292

291293
### `--git-output-to-stderr`
292294

293-
If `--git-output-to-stderr` is used, git commands output is redirected to `stderr`.
295+
Redirects git commands output to `stderr`.
294296

295-
Useful when used with `--changelog-to-stdout` and piping the output to a file,
297+
Useful when used with `--changelog-to-stdout` and piping the output to a file.
296298

297299
For example, `git commit` output may pollute `stdout`, so it is recommended to use this flag when piping the output to a file.
298300

@@ -305,7 +307,7 @@ Useful to combine with code formatters, like [Prettier](https://prettier.io/).
305307

306308
### `--major-version-zero`
307309

308-
Breaking changes does not bump the major version number.
310+
Breaking changes do not bump the major version number.
309311

310312
Say you have a project with the version `0.1.x` and you commit a breaking change like this:
311313

@@ -343,7 +345,7 @@ Then the version of your project will be bumped to `0.2.0` instead of `1.0.0`.
343345

344346
### `--gpg-sign`
345347

346-
Create gpg signed tags.
348+
Creates gpg signed tags.
347349

348350
```bash
349351
cz bump --gpg-sign
@@ -366,18 +368,16 @@ See [the template customization section](../customization.md#customizing-the-cha
366368

367369
### `--build-metadata`
368370

369-
Provides a way to specify additional metadata in the version string. This parameter is not compatible with `--local-version` as it uses the same part of the version string.
371+
Specifies additional metadata in the version string.
370372

371373
```bash
374+
# creates a version like `1.1.2+yourmetadata`.
372375
cz bump --build-metadata yourmetadata
373376
```
374377

375-
Will create a version like `1.1.2+yourmetadata`.
376-
377-
This can be useful for multiple things
378-
379-
- Git hash in version
380-
- Labeling the version with additional metadata.
378+
!!! note "Example usage"
379+
- Git hash in version
380+
- Labeling the version with additional metadata.
381381

382382
!!! note
383383
Commitizen ignores everything after `+` when it bumps the version.
@@ -391,16 +391,19 @@ This can be useful for multiple things
391391
- Version `1.2.3+a`, and `1.2.3+b` are the same version! Tools should not use the string after `+` for version calculation. This is probably not a guarantee (example in helm) even tho it is in the spec.
392392
- It might be problematic having the metadata in place when doing upgrades depending on what tool you use.
393393

394+
!!! warning
395+
This parameter is not compatible with `--local-version` as it uses the same part of the version string.
396+
394397
### `--get-next`
395398

396-
Provides a way to determine the next version and write it to stdout. This parameter is not compatible with `--changelog`
397-
and `manual version`.
399+
Similar to `--dry-run` but only outputs the next version.
398400

399401
```bash
402+
# outputs 1.0.1 if the current version is 1.0.0 and the increment is PATCH
400403
cz bump --get-next
401404
```
402405

403-
Will only output the next version, e.g., `1.2.3`. This can be useful for determining the next version based on CI for non-production environments/builds.
406+
Useful for determining the next version based on CI for non-production environments/builds.
404407

405408
!!! note "Compare with `--dry-run`"
406409
`--dry-run` provides a more detailed output including the changes as they would appear in the changelog file, while `--get-next` only outputs the next version.
@@ -426,15 +429,27 @@ Will only output the next version, e.g., `1.2.3`. This can be useful for determi
426429

427430
### `--allow-no-commit`
428431

429-
Allow the project version to be bumped even when there's no eligible version. This is most useful when used with `--increment {MAJOR,MINOR,PATCH}` or `[MANUAL_VERSION]`
432+
Allow the project version to be bumped even when there's no eligible version.
430433

431-
```sh
432-
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
433-
cz bump --incremental MINOR --allow-no-commit
434+
!!! note "Example usage"
435+
```sh
436+
# bump a minor version even when there's only bug fixes, documentation changes or even no commits
434437

435-
# bump version to 2.0.0 even when there's no breaking changes changes or even no commits
436-
cz bump --allow-no-commit 2.0.0
437-
```
438+
cz bump --increment MINOR --allow-no-commit
439+
440+
# bump version to 2.0.0 even when there's no breaking changes or even no commits
441+
cz bump --allow-no-commit 2.0.0
442+
```
443+
444+
!!! note "Default increment"
445+
The increment is overridden to `PATCH` if there is no increment detected or specified.
446+
447+
In other words, `cz bump --allow-no-commit` allows you to bump the version to the next patch version even when there is no eligible commit.
448+
449+
```sh
450+
# will bump to `1.0.1` if the current version is `1.0.0`.
451+
cz bump --allow-no-commit
452+
```
438453

439454
### `--version-scheme`
440455

@@ -479,19 +494,19 @@ Supported variables:
479494

480495
| Variable | Description |
481496
|--------------------------------|---------------------------------------------|
482-
| `$version`, `${version}` | fully generated version |
497+
| `$version`, `${version}` | fully generated version |
483498
| `$major`, `${major}` | MAJOR increment |
484499
| `$minor`, `${minor}` | MINOR increment |
485500
| `$patch`, `${patch}` | PATCH increment |
486501
| `$prerelease`, `${prerelease}` | Prerelease (alpha, beta, release candidate) |
487-
| `$devrelease`, ${devrelease}` | Development release |
502+
| `$devrelease`, `${devrelease}` | Development release |
488503

489504
### `version_files`
490505

491506
Identify the files or glob patterns which should be updated with the new version.
492507

493508
Commitizen will update its configuration file automatically when bumping,
494-
regarding if the file is present or not in `version_files`.
509+
regardless of whether the file is present or not in `version_files`.
495510

496511
You may specify the `version_files` in your configuration file.
497512

@@ -685,7 +700,7 @@ See [Version Schemes](#version-schemes-version-scheme).
685700
Some situations from Commitizen raise an exit code different from 0.
686701
If the error code is different from 0, any CI or script running Commitizen might be interrupted.
687702

688-
If you have a special use case, where you don't want to raise one of this error codes, you can
703+
If you have a special use case, where you don't want to raise one of these error codes, you can
689704
tell Commitizen to not raise them.
690705

691706
### Recommended use case

docs/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ cookiecutter gh:commitizen-tools/commitizen_cz_template
207207

208208
See [commitizen_cz_template](https://github.com/commitizen-tools/commitizen_cz_template) for details.
209209

210-
Once you publish your rules, you can send us a PR to the [Third-party section](./third-party-commitizen.md).
210+
Once you publish your rules, you can send us a PR to the [Third-party section](./third-party-plugins/about.md).
211211

212212
### Custom commit rules
213213

docs/external_links.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
## Talks
44

55
| Name | Speaker | Occasion | Language | Extra |
6-
| ------------------------------------------------------------------------- | --------------- | ---------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
7-
| commitizen-tools: What can we gain from crafting a git message convention | Wei Lee | Taipei.py 2020 June Meetup, Remote Python Pizza 2020 | English | [slides](https://speakerdeck.com/leew/commitizen-tools-what-can-we-gain-from-crafting-a-git-message-convention-at-taipey-dot-py) |
8-
| Automating release cycles | Santiago Fraire | PyAmsterdam June 24, 2020, Online | English | [slides](https://woile.github.io/commitizen-presentation/) |
9-
| [Automatizando Releases con Commitizen y Github Actions][automatizando] | Santiago Fraire | PyConAr 2020, Remote | Español | [slides](https://woile.github.io/automating-releases-github-actions-presentation/#/) |
6+
| ------------------------------------------------------------------------- | --------------- | ---------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
7+
| [Atomic Commits: An Easy & Proven Way to Manage & Automate Release Process](https://www.youtube.com/watch?v=IxzN9ClXhs8) | Wei Lee | COSCUP 2023 | Taiwanese Mandarin | [slides](https://speakerdeck.com/leew/atomic-commits-an-easy-and-proven-way-to-manage-and-automate-release-process) |
8+
| commitizen-tools: What can we gain from crafting a git message convention | Wei Lee | Taipei.py 2020 June Meetup, Remote Python Pizza 2020 | English | [slides](https://speakerdeck.com/leew/commitizen-tools-what-can-we-gain-from-crafting-a-git-message-convention-at-taipey-dot-py) |
9+
| Automating release cycles | Santiago Fraire | PyAmsterdam June 24, 2020, Online | English | [slides](https://woile.github.io/commitizen-presentation/) |
10+
| [Automatizando Releases con Commitizen y Github Actions][automatizando] | Santiago Fraire | PyConAr 2020, Remote | Español | [slides](https://woile.github.io/automating-releases-github-actions-presentation/#/) |
1011

1112
## Articles
1213

13-
- [Python Table Manners - Commitizen: 規格化 commit message](https://lee-w.github.io/posts/tech/2020/03/python-table-manners-commitizen/) (Written in Traditional Mandarin)
14+
- [Python Table Manners - Commitizen: 規格化 commit message](https://blog.wei-lee.me/posts/tech/2020/03/python-table-manners-commitizen/) (Written in Traditional Mandarin)
1415
- [Automating semantic release with commitizen](https://woile.dev/posts/automating-semver-releases-with-commitizen/) (English)
1516
- [How to Write Better Git Commit Messages – A Step-By-Step Guide](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/?utm_source=tldrnewsletter) (English)
1617
- [Continuous delivery made easy (in Python)](https://medium.com/dev-genius/continuous-delivery-made-easy-in-python-c085e9c82e69)

0 commit comments

Comments
 (0)