Skip to content

Commit 0cb4f04

Browse files
Merge branch 'master' into doc-config
2 parents 0679381 + 1930674 commit 0cb4f04

File tree

10 files changed

+99
-45
lines changed

10 files changed

+99
-45
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@v4
15+
uses: actions/checkout@v5
1616
with:
1717
fetch-depth: 0
1818
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"

.github/workflows/docspublish.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ on:
44
push:
55
branches:
66
- master
7+
workflow_dispatch:
78

89
jobs:
910
update-cli-screenshots:
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1314
with:
1415
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
1516
fetch-depth: 0
@@ -42,7 +43,7 @@ jobs:
4243
runs-on: ubuntu-latest
4344
needs: update-cli-screenshots
4445
steps:
45-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v5
4647
with:
4748
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
4849
fetch-depth: 0
@@ -58,21 +59,19 @@ jobs:
5859
python -m pip install -U pip poetry poethepoet
5960
poetry --version
6061
poetry install --no-root --only documentation
61-
- name: Build docs
62-
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
run: |
65-
poetry doc:build
6662
- name: Generate Sponsors 💖
6763
uses: JamesIves/github-sponsors-readme-action@v1
6864
with:
6965
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_FOR_ORG }}
7066
file: "docs/README.md"
71-
- name: Push doc to Github Page
72-
uses: peaceiris/actions-gh-pages@v4
67+
organization: true
68+
- name: Build docs
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: |
72+
poetry doc:build
73+
- name: Deploy 🚀
74+
uses: JamesIves/github-pages-deploy-action@v4
7375
with:
74-
personal_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
75-
publish_branch: gh-pages
76-
publish_dir: ./site
77-
user_name: "github-actions[bot]"
78-
user_email: "github-actions[bot]@users.noreply.github.com"
76+
folder: ./site # The folder the action should deploy.
77+
branch: gh-pages

.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@v4
15+
uses: actions/checkout@v5
1616
- name: Set up Python
1717
uses: actions/setup-python@v5
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@v4
27+
uses: dawidd6/action-homebrew-bump-formula@v5
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@v4
12+
- uses: actions/checkout@v5
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@v4
13+
- uses: actions/checkout@v5
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@v4
12+
- uses: actions/checkout@v5
1313
with:
1414
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
1515
fetch-depth: 0

docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Before installing Commitizen, ensure you have:
6363
#### Global Installation (Recommended)
6464

6565
The recommended way to install Commitizen is using [`pipx`](https://pipx.pypa.io/) or [`uv`](https://docs.astral.sh/uv/), which ensures a clean, isolated installation:
66+
6667
**Using pipx:**
6768
```bash
6869
# Install Commitizen
@@ -111,7 +112,7 @@ poetry add commitizen --dev
111112

112113
**Using uv:**
113114
```bash
114-
uv add commitizen
115+
uv add --dev commitizen
115116
```
116117

117118
**Using pdm:**

docs/commands/bump.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cz bump --version-scheme semver
3131
```
3232

3333
2. Configuration file:
34-
```toml
34+
```toml title="pyproject.toml"
3535
[tool.commitizen]
3636
version_scheme = "semver"
3737
```
@@ -113,7 +113,7 @@ Note that as per [semantic versioning spec](https://semver.org/#spec-item-9)
113113
For example, the following versions (using the [PEP 440](https://peps.python.org/pep-0440/) scheme) are ordered
114114
by their precedence and showcase how a release might flow through a development cycle:
115115

116-
- `1.0.0` is the current published version
116+
- `1.0.0` is the currently published version
117117
- `1.0.1a0` after committing a `fix:` for pre-release
118118
- `1.1.0a1` after committing an additional `feat:` for pre-release
119119
- `1.1.0b0` after bumping a beta release
@@ -153,7 +153,7 @@ cz bump --check-consistency
153153

154154
For example, if we have `pyproject.toml`
155155

156-
```toml
156+
```toml title="pyproject.toml"
157157
[tool.commitizen]
158158
version = "1.21.0"
159159
version_files = [
@@ -162,15 +162,16 @@ version_files = [
162162
]
163163
```
164164

165-
`src/__version__.py`,
165+
`src/__version__.py`
166166

167-
```python
167+
168+
```python title="src/__version__.py"
168169
__version__ = "1.21.0"
169170
```
170171

171-
and `setup.py`.
172+
and `setup.py`
172173

173-
```python
174+
```python title="setup.py"
174175
from setuptools import setup
175176

176177
setup(..., version="1.0.5", ...)
@@ -193,7 +194,7 @@ cz bump --local-version
193194

194195
For example, if we have `pyproject.toml`
195196

196-
```toml
197+
```toml title="pyproject.toml"
197198
[tool.commitizen]
198199
version = "5.3.5+0.1.0"
199200
```
@@ -454,7 +455,7 @@ In your `pyproject.toml` or `.cz.toml`
454455
tag_format = "v$major.$minor.$patch$prerelease"
455456
```
456457

457-
The variables must be preceded by a `$` sign and optionally can be wrapped in `{}` . Default is `$version`.
458+
The variables must be preceded by a `$` sign and optionally can be wrapped in `{}`. The default is `$version`.
458459

459460
Supported variables:
460461

@@ -471,7 +472,7 @@ Supported variables:
471472

472473
### `version_files` \*
473474

474-
It is used to identify the files which should be updated with the new version.
475+
It is used to identify the files or glob patterns which should be updated with the new version.
475476
It is also possible to provide a pattern for each file, separated by colons (`:`).
476477

477478
Commitizen will update its configuration file automatically (`pyproject.toml`, `.cz`) when bumping,
@@ -483,11 +484,12 @@ Some examples
483484

484485
`pyproject.toml`, `.cz.toml` or `cz.toml`
485486

486-
```toml
487+
```toml title="pyproject.toml"
487488
[tool.commitizen]
488489
version_files = [
489490
"src/__version__.py",
490-
"setup.py:version"
491+
"packages/*/pyproject.toml:version",
492+
"setup.py:version",
491493
]
492494
```
493495

@@ -496,8 +498,7 @@ This means that it will find a file `setup.py` and will only make a change
496498
in a line containing the `version` substring.
497499

498500
!!! note
499-
Files can be specified using relative (to the execution) paths, absolute paths
500-
or glob patterns.
501+
Files can be specified using relative (to the execution) paths, absolute paths, or glob patterns.
501502

502503
---
503504

@@ -516,7 +517,7 @@ Some examples
516517

517518
`pyproject.toml`, `.cz.toml` or `cz.toml`
518519

519-
```toml
520+
```toml title="pyproject.toml"
520521
[tool.commitizen]
521522
bump_message = "release $current_version → $new_version [skip-ci]"
522523
```
@@ -529,7 +530,7 @@ When set to `true` the changelog is always updated incrementally when running `c
529530

530531
Defaults to: `false`
531532

532-
```toml
533+
```toml title="pyproject.toml"
533534
[tool.commitizen]
534535
update_changelog_on_bump = true
535536
```
@@ -540,7 +541,7 @@ update_changelog_on_bump = true
540541

541542
When set to `true`, Commitizen will create annotated tags.
542543

543-
```toml
544+
```toml title="pyproject.toml"
544545
[tool.commitizen]
545546
annotated_tag = true
546547
```
@@ -551,7 +552,7 @@ annotated_tag = true
551552

552553
When set to `true`, Commitizen will create gpg signed tags.
553554

554-
```toml
555+
```toml title="pyproject.toml"
555556
[tool.commitizen]
556557
gpg_sign = true
557558
```
@@ -565,7 +566,7 @@ Useful during the initial development stage of your project.
565566

566567
Defaults to: `false`
567568

568-
```toml
569+
```toml title="pyproject.toml"
569570
[tool.commitizen]
570571
major_version_zero = true
571572
```
@@ -591,7 +592,7 @@ execution of the script, some environment variables are available:
591592
| `CZ_PRE_INCREMENT` | Whether this is a `MAJOR`, `MINOR` or `PATH` release |
592593
| `CZ_PRE_CHANGELOG_FILE_NAME` | Path to the changelog file, if available |
593594

594-
```toml
595+
```toml title="pyproject.toml"
595596
[tool.commitizen]
596597
pre_bump_hooks = [
597598
"scripts/generate_documentation.sh"
@@ -618,7 +619,7 @@ release. During execution of the script, some environment variables are availabl
618619
| `CZ_POST_INCREMENT` | Whether this was a `MAJOR`, `MINOR` or `PATH` release |
619620
| `CZ_POST_CHANGELOG_FILE_NAME` | Path to the changelog file, if available |
620621

621-
```toml
622+
```toml title="pyproject.toml"
622623
[tool.commitizen]
623624
post_bump_hooks = [
624625
"scripts/slack_notification.sh"
@@ -631,7 +632,7 @@ Offset with which to start counting prereleases.
631632

632633
Defaults to: `0`
633634

634-
```toml
635+
```toml title="pyproject.toml"
635636
[tool.commitizen]
636637
prerelease_offset = 1
637638
```
@@ -651,7 +652,7 @@ Options: `pep440`, `semver`, `semver2`
651652

652653
Defaults to: `pep440`
653654

654-
```toml
655+
```toml title="pyproject.toml"
655656
[tool.commitizen]
656657
version_scheme = "semver"
657658
```

docs/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Current version. Example: `"0.1.2"`. Required if you use `version_provider = "co
2121
- Type: `list`
2222
- Default: `[]`
2323

24-
Files were the version will be updated. A pattern to match a line, can also be specified, separated by `:`. [Read more][version_files]
24+
Files (or glob patterns) where the version will be updated. A pattern to match a line, can also be specified, separated by `:` [Read more][version_files]
2525

2626
### `version_provider`
2727

docs/third-party-commitizen.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,56 @@ commitizen:
145145
version_provider: deno-provider
146146
version_scheme: semver
147147
```
148+
149+
### [cz-path](https://pypi.org/project/cz-path/)
150+
151+
Provides prefix choices for commit messages based on staged files (Git only).
152+
For example, if the staged files are `component/z/a.ts` and `component/z/b.ts`,
153+
the path prefix option will be `component/z` and commit message might look like:
154+
`component/z/: description of changes`. If only one file is staged, the extension
155+
is removed in the prefix.
156+
157+
#### Installation
158+
159+
```sh
160+
pip install cz-path
161+
```
162+
163+
#### Usage
164+
165+
Add `cz-path` to your configuration file.
166+
167+
Example for `.cz.json`:
168+
169+
```json
170+
{
171+
"commitizen": {
172+
"name": "cz_path",
173+
"remove_path_prefixes": ["src", "module_name"]
174+
}
175+
}
176+
```
177+
178+
The default value for `remove_path_prefixes` is `["src"]`. Adding `/` to the
179+
prefixes is not required.
180+
181+
#### Example session
182+
183+
```plain
184+
$ git add .vscode/
185+
$ cz -n cz_path c
186+
? Prefix: (Use arrow keys)
187+
» .vscode
188+
.vscode/
189+
project
190+
(empty)
191+
? Prefix: .vscode
192+
? Commit title: adjust settings
193+
194+
.vscode: adjust settings
195+
196+
[main 0000000] .vscode: adjust settings
197+
2 files changed, 1 insertion(+), 11 deletions(-)
198+
199+
Commit successful!
200+
```

0 commit comments

Comments
 (0)