Skip to content

Commit 5733686

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 b76057d commit 5733686

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

.conventional-changelog-lintrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.flowconfig

Lines changed: 1 addition & 0 deletions
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

Lines changed: 25 additions & 0 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
"documentation": "documentation build ./src --format md --access public --output ./API.md && gitdown ./.README/README.md --output-file ./README.md",
2525
"lint": "eslint ./src ./tests",
2626
"precommit": "npm run lint && npm run test",
27-
"commitmsg": "conventional-changelog-lint -e"
27+
"commitmsg": "commitlint -e"
2828
},
2929
"devDependencies": {
30+
"@commitlint/cli": "3.0.3",
3031
"babel-cli": "^6.11.4",
3132
"babel-plugin-add-module-exports": "^0.2.1",
3233
"babel-plugin-istanbul": "^2.0.0",
@@ -38,8 +39,6 @@
3839
"babel-preset-es2015-node4": "^2.1.0",
3940
"babel-register": "^6.11.6",
4041
"chai": "^3.5.0",
41-
"conventional-changelog-cli": "^1.2.0",
42-
"conventional-changelog-lint": "^1.0.1",
4342
"conventional-changelog-lint-config-canonical": "^1.0.0",
4443
"conventional-recommended-bump": "^0.3.0",
4544
"coveralls": "^2.11.12",

0 commit comments

Comments
 (0)