Skip to content

Commit

Permalink
Fix pre-commit hook config (#164)
Browse files Browse the repository at this point in the history
Moved gitlint args from pre-commit's entry to args.

Updated docs to reflect best way to add additional arguments.

Closes #163
  • Loading branch information
Cielquan authored Nov 1, 2020
1 parent 4eb8e07 commit 9de1f89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- id: gitlint
name: gitlint
language: python
entry: gitlint --staged --msg-filename
entry: gitlint
args: [--staged, --msg-filename]
stages: [commit-msg]
9 changes: 6 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,14 @@ your `.pre-commit-config.yaml` file like so:
rev: # Fill in a tag / sha here
hooks:
- id: gitlint
stages: [commit-msg]
entry: gitlint
args: [--contrib=CT1, --msg-filename]
```
!!! important
You need to add `--msg-filename` at the end of your custom `args` list as the gitlint-hook will fail otherwise.


## Using gitlint in a CI environment
By default, when just running `gitlint` without additional parameters, gitlint lints the last commit in the current
working directory.
Expand Down Expand Up @@ -426,4 +429,4 @@ Exit Code | Description
-----------|------------------------------------------------------------
253 | Wrong invocation of the `gitlint` command.
254 | Something went wrong when invoking git.
255 | Invalid gitlint configuration
255 | Invalid gitlint configuration

0 comments on commit 9de1f89

Please sign in to comment.