You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I just found this great project and I would like to use it with pre-commit to enforce conventional commit style messages.
I've set up my .pre-commit-config.yml like this:
default_stages: [commit, push]repos:
# many other commit hooks here...
- repo: https://github.com/jorisroovers/gitlintrev: v0.12.0hooks:
- id: gitlintstages: [commit-msg]args: [--contrib=CT1]
and correctly installed the hooks.
When I try to commit something, I get
gitlint..................................................................Failed
hookid: gitlint
Usage: gitlint [OPTIONS] COMMAND [ARGS]...
Try "gitlint --help" for help.
Error: Invalid value for "--msg-filename": Could not open file: --contrib=CT1: No such file or directory
TIL, I didn't know this! I agree that working around this is probably not that easy. Sounds more like something we should document in the gitlint pre-commit docs section.
Alternatively, I think using a .gitlint file to specify contrib should also work.
Hi,
I just found this great project and I would like to use it with pre-commit to enforce conventional commit style messages.
I've set up my
.pre-commit-config.yml
like this:and correctly installed the hooks.
When I try to commit something, I get
This is because of how arguments are passed by pre-commit.
The workaround is overriding the hook entry and putting --msg-filename at the end of the args:
Not sure how it can be solved without major changes involving passing the commit file as positional argument.
The text was updated successfully, but these errors were encountered: