Skip to content

docs: improve setup instructions for pre-commit #564

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
Aug 21, 2022
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
10 changes: 9 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ cz commit -s
```

### Integrating with Pre-commit
Commitizen can lint your commit messages for you with `cz check`.

Commitizen can lint your commit message for you with `cz check`.

You can integrate this in your [pre-commit](https://pre-commit.com/) config with:

```yaml
Expand All @@ -128,6 +130,12 @@ If you aren't using both hooks, you needn't install both stages.
| commitizen | commit-msg |
| commitizen-branch | pre-push |

Note that pre-commit discourages using `master` as a revision, and the above command will print a warning. You should replace the `master` revision with the [latest tag](https://github.com/commitizen-tools/commitizen/tags). This can be done automatically with:

```sh
pre-commit autoupdate
```

Read more about the `check` command [here](check.md).

### Help
Expand Down