Skip to content

Commit

Permalink
fix(pre-commit): Use new --allow-abort option
Browse files Browse the repository at this point in the history
Prevent pre-commit hook from complaining when a commit is aborted by
default, but allow users to override this option in their pre-commit
config by specifying it in args, not entry. Move --commit-msg-file
option from entry to args since it has to be the last option.
  • Loading branch information
Kurt-von-Laven authored and Lee-W committed May 22, 2022
1 parent ab3f43d commit d55acad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
- id: commitizen
name: commitizen check
description: "Check whether the commit message follows commiting rules"
entry: cz check --commit-msg-file
entry: cz check
args: [--allow-abort, --commit-msg-file]
stages: [commit-msg]
language: python
language_version: python3
Expand Down
2 changes: 1 addition & 1 deletion docs/auto_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Open the file and edit it:
```sh
#!/bin/bash
MSG_FILE=$1
cz check --commit-msg-file $MSG_FILE
cz check --allow-abort --commit-msg-file $MSG_FILE
```

Where `$1` is the name of the temporary file that contains the current commit message. To be more explicit, the previous variable is stored in another variable called `$MSG_FILE`, for didactic purposes.
Expand Down

0 comments on commit d55acad

Please sign in to comment.