Skip to content

Commit 72350ee

Browse files
committed
feat(commitlint-travis): add a hook for linting commits on Travis CI
1 parent 1d60455 commit 72350ee

File tree

4 files changed

+154
-1
lines changed

4 files changed

+154
-1
lines changed

.pre-commit-hooks.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@
44
language: node
55
entry: commitlint --edit
66
verbose: false
7+
- id: commitlint-travis
8+
name: Check commit messages on Travis CI
9+
description: Lint all relevant commits for a change or PR on Travis CI
10+
language: node
11+
entry: commitlint-travis
12+
always_run: true
13+
pass_filenames: false

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,20 @@
2525
```shell
2626
pre-commit install --hook-type commit-msg
2727
```
28+
29+
### Usage in Travis CI
30+
31+
- Add the following to your `.pre-commit-config.yaml`:
32+
```
33+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
34+
rev: <latest tag>
35+
hooks:
36+
- id: commitlint-travis
37+
stages: [manual]
38+
```
39+
- Add the following to your `.travis.yml`:
40+
```
41+
script:
42+
- pip install pre-commit
43+
- pre-commit run --hook-stage manual commitlint-travis
44+
```

package-lock.json

Lines changed: 127 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
"author": "Alessandro Cuppari <[email protected]>",
88
"license": "MIT",
99
"bin": {
10-
"commitlint": "./node_modules/@commitlint/cli/lib/cli.js"
10+
"commitlint": "./node_modules/@commitlint/cli/lib/cli.js",
11+
"commitlint-travis": "./node_modules/@commitlint/travis-cli/lib/cli.js"
1112
},
1213
"dependencies": {
1314
"@commitlint/cli": "8.3.4",
15+
"@commitlint/travis-cli": "8.3.4",
1416
"core-js": "^3.6.4"
1517
}
1618
}

0 commit comments

Comments
 (0)