Skip to content

Commit 89c92a9

Browse files
author
craig-mulligan
committed
chore: fix CI
ignore offending documentation module in .flow update conventional-changelog-lint to include https://github.com/marionebl/commitlint/issues/13 connects to broken build https://travis-ci.org/gajus/gitinfo/builds/254646852
1 parent d6ef603 commit 89c92a9

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

.conventional-changelog-lintrc

-5
This file was deleted.

.flowconfig

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.*/node_modules/config-chain/test/broken.json
44
.*/node_modules/npmconf/test/fixtures/package.json
55
.*/node_modules/conventional-changelog-core/test/fixtures/_malformation.json
6+
.*/node_modules/documentation/.*
67
.*/__tests__/.*
78

89
[include]

.scripts/lint-commits.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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"

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ node_js:
44
- 5
55
- 4
66
before_install:
7+
- git fetch --unshallow
78
- npm config set depth 0
89
- npm install --global npm@3
910
script:
11+
- /bin/bash ./.scripts/lint-commits.sh
1012
- NODE_ENV=development npm run build
1113
- rm -fr ./dist
1214
- NODE_ENV=production npm run build
@@ -16,7 +18,6 @@ script:
1618
- nyc --silent npm run test
1719
- nyc report --reporter=text-lcov | coveralls
1820
- nyc check-coverage --lines 90
19-
- conventional-changelog-lint --from=HEAD~$(git --no-pager rev-list master..HEAD --count)
2021
after_success:
2122
- travis-after-all && ./.scripts/release.sh
2223
notifications:

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
"documentation": "documentation build ./src --format md --access public --output ./API.md && gitdown ./.README/README.md --output-file ./README.md",
2626
"lint": "eslint ./src ./tests",
2727
"precommit": "npm run lint && npm run test",
28-
"commitmsg": "conventional-changelog-lint -e"
28+
"commitmsg": "commitlint -e"
2929
},
3030
"devDependencies": {
31+
"@commitlint/cli": "3.0.3",
3132
"babel-cli": "^6.11.4",
3233
"babel-plugin-add-module-exports": "^0.2.1",
3334
"babel-plugin-istanbul": "^2.0.0",
@@ -39,8 +40,6 @@
3940
"babel-preset-es2015-node4": "^2.1.0",
4041
"babel-register": "^6.11.6",
4142
"chai": "^3.5.0",
42-
"conventional-changelog-cli": "^1.2.0",
43-
"conventional-changelog-lint": "^1.0.1",
4443
"conventional-changelog-lint-config-canonical": "^1.0.0",
4544
"conventional-recommended-bump": "^0.3.0",
4645
"coveralls": "^2.11.12",

0 commit comments

Comments
 (0)