Skip to content

Commit 4cb940a

Browse files
author
Ray Schamp
committed
chore(semver): add commit-lint
Use commit-lint commit hooks so that our commits will work with semver. Also works with Travis so PRs containing invalid commits will fail tests.
1 parent 79d5b8f commit 4cb940a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ before_install:
1111
- npm i -g npm@^2.0.0
1212
before_script:
1313
- npm prune
14+
script:
15+
- commitlint-travis
16+
- npm test
1417
after_success:
1518
- npm run semantic-release
1619
branches:

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@commitlint/config-conventional']};

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"url": "https://github.com/LLK/scratch-parser.git"
1111
},
1212
"scripts": {
13+
"commitmsg": "commitlint -e $GIT_PARAMS",
1314
"test:lint": "eslint . --ext=js",
1415
"test:unit": "tap test/unit/*.js",
1516
"test:integration": "tap test/integration/*.js",
@@ -25,12 +26,16 @@
2526
"gzip-js": "0.3.2"
2627
},
2728
"devDependencies": {
29+
"@commitlint/cli": "6.1.0",
30+
"@commitlint/config-conventional": "6.1.0",
31+
"@commitlint/travis-cli": "6.1.0",
2832
"babel-eslint": "8.2.2",
2933
"benchmark": "^2.1.1",
3034
"cz-conventional-changelog": "^2.1.0",
3135
"eslint": "^4.19.1",
3236
"eslint-config-scratch": "5.0.0",
3337
"glob": "^7.0.6",
38+
"husky": "0.14.3",
3439
"semantic-release": "^15.1.4",
3540
"tap": "^11.1.3"
3641
},

0 commit comments

Comments
 (0)