File tree 5 files changed +30
-9
lines changed
5 files changed +30
-9
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
.*/node_modules/config-chain/test/broken.json
4
4
.*/node_modules/npmconf/test/fixtures/package.json
5
5
.*/node_modules/conventional-changelog-core/test/fixtures/_malformation.json
6
+ .*/node_modules/documentation/.*
6
7
.*/__tests__/.*
7
8
8
9
[include]
Original file line number Diff line number Diff line change
1
+ # lint-commits.sh
2
+ #! /bin/bash
3
+ set -e
4
+ set -u
5
+
6
+ if [[ $TRAVIS_PULL_REQUEST_SLUG != " " && $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]]; then
7
+ # This is a Pull Request from a different slug, hence a forked repository
8
+ git remote add " $TRAVIS_PULL_REQUEST_SLUG " " https://github.com/$TRAVIS_PULL_REQUEST_SLUG .git"
9
+ git fetch " $TRAVIS_PULL_REQUEST_SLUG "
10
+
11
+ # Use the fetched remote pointing to the source clone for comparison
12
+ TO=" $TRAVIS_PULL_REQUEST_SLUG /$TRAVIS_PULL_REQUEST_BRANCH "
13
+ else
14
+ # This is a Pull Request from the same remote, no clone repository
15
+ TO=$TRAVIS_COMMIT
16
+ fi
17
+
18
+ # Lint all commits in the PR
19
+ # - Covers fork pull requests (when TO=slug/branch)
20
+ # - Covers branch pull requests (when TO=branch)
21
+ ./node_modules/.bin/commitlint --from=" $TRAVIS_BRANCH " --to=" $TO "
22
+
23
+ # Always lint the triggerig commit
24
+ # - Covers direct commits
25
+ ./node_modules/.bin/commitlint --from=" $TRAVIS_COMMIT "
Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ node_js:
4
4
- 5
5
5
- 4
6
6
before_install :
7
+ - git fetch --unshallow
7
8
- npm config set depth 0
8
9
- npm install --global npm@3
9
10
script :
11
+ - /bin/bash ./.scripts/lint-commits.sh
10
12
- NODE_ENV=development npm run build
11
13
- rm -fr ./dist
12
14
- NODE_ENV=production npm run build
@@ -16,7 +18,6 @@ script:
16
18
- nyc --silent npm run test
17
19
- nyc report --reporter=text-lcov | coveralls
18
20
- nyc check-coverage --lines 90
19
- - conventional-changelog-lint --from=HEAD~$(git --no-pager rev-list master..HEAD --count)
20
21
after_success :
21
22
- travis-after-all && ./.scripts/release.sh
22
23
notifications :
Original file line number Diff line number Diff line change 25
25
"documentation" : " documentation build ./src --format md --access public --output ./API.md && gitdown ./.README/README.md --output-file ./README.md" ,
26
26
"lint" : " eslint ./src ./tests" ,
27
27
"precommit" : " npm run lint && npm run test" ,
28
- "commitmsg" : " conventional-changelog-lint -e"
28
+ "commitmsg" : " commitlint -e"
29
29
},
30
30
"devDependencies" : {
31
+ "@commitlint/cli" : " 3.0.3" ,
31
32
"babel-cli" : " ^6.11.4" ,
32
33
"babel-plugin-add-module-exports" : " ^0.2.1" ,
33
34
"babel-plugin-istanbul" : " ^2.0.0" ,
39
40
"babel-preset-es2015-node4" : " ^2.1.0" ,
40
41
"babel-register" : " ^6.11.6" ,
41
42
"chai" : " ^3.5.0" ,
42
- "conventional-changelog-cli" : " ^1.2.0" ,
43
- "conventional-changelog-lint" : " ^1.0.1" ,
44
43
"conventional-changelog-lint-config-canonical" : " ^1.0.0" ,
45
44
"conventional-recommended-bump" : " ^0.3.0" ,
46
45
"coveralls" : " ^2.11.12" ,
You can’t perform that action at this time.
0 commit comments