I'm using the pygrep in pre-commit
and here is my settings:
- repo: local
hooks:
- id: jira-ticket
name: check for jira ticket
entry: '(ERP-[0-9]+ #(feat|fix|docs|style|refactor|perf|test|chore) .+)'
args: [--multiline]
language: pygrep
stages: [commit-msg]
I want to check the commit message format but no mater what I entered, it always returns true.
$ git commit -m "why"
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\oliver.chiu\.cache\pre-commit\patch1657183664-20160.
[INFO] Restored changes from C:\Users\oliver.chiu\.cache\pre-commit\patch1657183664-20160.
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\oliver.chiu\.cache\pre-commit\patch1657183666-11436.
check for jira ticket....................................................Passed
[INFO] Restored changes from C:\Users\oliver.chiu\.cache\pre-commit\patch1657183666-11436.
[purchase_merge_ui dc8bafc9] why
1 file changed, 1 deletion(-)