Skip to content

docs(docs/third-party-commitizen.md): Add cz-path info #1559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/third-party-commitizen.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,56 @@ commitizen:
version_provider: deno-provider
version_scheme: semver
```

### [cz-path](https://pypi.org/project/cz-path/)

Provides prefix choices for commit messages based on staged files (Git only).
For example, if the staged files are `component/z/a.ts` and `component/z/b.ts`,
the path prefix option will be `component/z` and commit message might look like:
`component/z/: description of changes`. If only one file is staged, the extension
is removed in the prefix.

#### Installation

```sh
pip install cz-path
```

#### Usage

Add `cz-path` to your configuration file.

Example for `.cz.json`:

```json
{
"commitizen": {
"name": "cz_path",
"remove_path_prefixes": ["src", "module_name"]
}
}
```

The default value for `remove_path_prefixes` is `["src"]`. Adding `/` to the
prefixes is not required.

#### Example session

```plain
$ git add .vscode/
$ cz -n cz_path c
? Prefix: (Use arrow keys)
» .vscode
.vscode/
project
(empty)
? Prefix: .vscode
? Commit title: adjust settings

.vscode: adjust settings

[main 0000000] .vscode: adjust settings
2 files changed, 1 insertion(+), 11 deletions(-)

Commit successful!
```
Loading