Skip to content

Commit a0914d1

Browse files
committed
chore: tweaks to commit linting
1 parent ac820c8 commit a0914d1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ node_js:
66
before_install:
77
- git fetch --unshallow
88
before_script:
9-
- npm run lint:prcommits
109
- npm run build
1110
script:
11+
- npm run travis:lint:commits
1212
- npm test

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"pretest": "npm run deps",
2222
"test": "ava",
2323
"lint": "xo *.js",
24-
"lint:prcommits": "./scripts/lint-prcommits.sh",
2524
"deps": "npm run build && dependency-check . --missing && dependency-check . --extra --no-dev -i conventional-changelog-angular -i conventional-changelog-lint-config-angular",
2625
"commitlint": "node distribution/cli.js --from=HEAD~1",
2726
"preversion": "npm run build && npm test",
2827
"release": "npm version --no-git-tag-version $(conventional-recommended-bump -p angular)",
2928
"version": "npm run changelog && git add .",
30-
"postversion": "git commit -m \"chore(release): v$npm_package_version\n$(conventional-changelog -p angular)\" && git tag -a v$npm_package_version -m \"$(conventional-changelog -p angular)\""
29+
"postversion": "git commit -m \"chore(release): v$npm_package_version\n$(conventional-changelog -p angular)\" && git tag -a v$npm_package_version -m \"$(conventional-changelog -p angular)\"",
30+
"travis:lint:commits": "./scripts/lint:commits.sh"
3131
},
3232
"ava": {
3333
"babel": "inherit",

scripts/lint-prcommits.sh renamed to scripts/lint:commits.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ else
1515
TO="$TRAVIS_PULL_REQUEST_BRANCH"
1616
fi
1717

18-
if [[ $TRAVIS_BRANCH == $TO ]]; then
19-
conventional-changelog-lint --from="HEAD~1"
20-
else
21-
conventional-changelog-lint --from="$TRAVIS_BRANCH" --to="$TO"
22-
fi
18+
# Lint all commits in the PR
19+
conventional-changelog-lint --from="$TRAVIS_BRANCH" --to="$TO"
20+
21+
# Always lint the triggerig commit
22+
conventional-changelog-lint --from="$TRAVIS_COMMIT"

0 commit comments

Comments
 (0)