-
According to https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md#run I should be able to have the following configuration to check commit messages: commit-msg:
skip:
- merge
- rebase
parallel: true
commands:
check-commit-msg:
run: python Git/hooks/commit-msg/check_commit_msg.py {1} But the $ lefthook run commit-msg
Traceback (most recent call last):
File "Git\hooks\commit-msg\check_commit_msg.py", line 104, in <module>
exit(main())
File "Git\hooks\commit-msg\check_commit_msg.py", line 82, in main
with open(commit_message_file) as commit_message:
FileNotFoundError: [Errno 2] No such file or directory: '{1}'
exit status 1summary: (done in 0.06 seconds)
🥊 check-commit-msg I don't see what I'm missing or doing differently from the docs. Can you help me ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey! I think you have this error because you run lefthook explicitly via
But if you want to test this hook, you can do the following:
I've appended an argument |
Beta Was this translation helpful? Give feedback.
Hey! I think you have this error because you run lefthook explicitly via
lefthook run commit-msg
.{1}
will be a commit message file only when running via git hook, so in your case this will work:But if you want to test this hook, you can do the following:
I've appended an argument
/tmp/commit-message
to the explicit call oflefthook
. In that case everything must work as expected,