-
-
Notifications
You must be signed in to change notification settings - Fork 299
Precommit docs #210
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
Precommit docs #210
Changes from 3 commits
f5e1133
48c97b5
6ec8169
2f76fe9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,7 @@ venv.bak/ | |
# mypy | ||
.mypy_cache/ | ||
|
||
.idea | ||
.vscode/ | ||
*.bak | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,20 @@ or the shortcut | |
cz c | ||
``` | ||
|
||
### Integrating with Pre-commit | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding this config file is not enough for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. This already assumes that the dev has run There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By default The following is how I test it. e.g., mkdir test-project cd test-project git init # add a .pre-commit-config.yaml without commitizen git add . git commit pre-commit install # add commitizen config to .pre-commit-config.yaml git add . git commit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @Lee-W, just to follow up, you're right. It needs the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I miss this part when I merged this PR. No worries. I'll add it in another PR. |
||
--- | ||
repos: | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v1.17.0 | ||
alecgerona marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
hooks: | ||
- id: commitizen | ||
stages: [commit-msg] | ||
``` | ||
Read more about the `check` command [here](https://commitizen-tools.github.io/commitizen/check/). | ||
|
||
### Help | ||
|
||
```bash | ||
|