Skip to content

Commit d55acad

Browse files
Kurt-von-LavenLee-W
authored andcommitted
fix(pre-commit): Use new --allow-abort option
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.
1 parent ab3f43d commit d55acad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.pre-commit-hooks.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
- id: commitizen
22
name: commitizen check
33
description: "Check whether the commit message follows commiting rules"
4-
entry: cz check --commit-msg-file
4+
entry: cz check
5+
args: [--allow-abort, --commit-msg-file]
56
stages: [commit-msg]
67
language: python
78
language_version: python3

docs/auto_check.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Open the file and edit it:
5050
```sh
5151
#!/bin/bash
5252
MSG_FILE=$1
53-
cz check --commit-msg-file $MSG_FILE
53+
cz check --allow-abort --commit-msg-file $MSG_FILE
5454
```
5555

5656
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.

0 commit comments

Comments
 (0)