Skip to content

Commit

Permalink
feat(release-info): add ci & build commit types
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Richter committed Jul 31, 2020
1 parent 3c86512 commit 96bd23a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ The empty lines between the different parts are required.
| **perf** | Performance optimizations | patch |
| **refactor** | Changes to the code structure without fixing bugs or adding features | patch |
| **chore** | Changes to the project setup and tools, dependency bumps, house-keeping | patch |
| **build** | Changes that affect the build system (e.g webpack, rollup, ...) | patch |
| **revert** | reverts a previous commit | patch |

||
| **docs** | Changes to the documentation | none |
| **style** | Cleanup & lint rule fixes. Note that often it's better to just amend the previous commit if it introduced lint errors | none |
| **test** | Fixing existing tests or adding missing ones. Just like with **style**, if you add tests to a feature you just introduced in the previous commit, consider keeping the tests, and the feature in the same commit instead. | none |
| **ci** | Changes to your CI configuration & scripts | none |
* `<subject>`: A [good git commit message subject](http://chris.beams.io/posts/git-commit/#limit-50).
- Keep it brief. If possible the whole first line should have at most 50 characters.
- Use an imperative mood. "Create" instead of "creates" or "created".
Expand Down
2 changes: 2 additions & 0 deletions lib/steps/release-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function determineReleaseInfo(commits, acceptInvalidCommits) {
case 'fix':
case 'refactor':
case 'perf':
case 'build':
case 'revert':
releaseType = Math.max(releaseType, 1);
break;
Expand All @@ -108,6 +109,7 @@ function determineReleaseInfo(commits, acceptInvalidCommits) {
case 'docs':
case 'style':
case 'test':
case 'ci':
case 'pr':
continue;

Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/patch-commits
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ git commit -m "chore: Adding refactor commit"
echo "console.log('more');" > perf.js
git add perf.js
git commit -m "chore: Adding perf commit"

echo "console.log('more');" > build.js
git add build.js
git commit -m "build: Adding perf commit"
4 changes: 4 additions & 0 deletions test/fixtures/silent-commits
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ echo "console.log('more');" > test.js
git add test.js
git commit -m "test: Adding test commit"

echo "console.log('more');" > ci.js
git add ci.js
git commit -m "ci: Adding ci commit"

echo "console.log('more');" > pr.js
git add pr.js
git commit -m "pr: Adding pr commit"
4 changes: 2 additions & 2 deletions test/steps/release-info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ git rebase -i --root

const testcases = [
{
desc: 'with "chore", "fix", "refactor" & "perf" commit type',
desc: 'with "chore", "fix", "refactor", "build" & "perf" commit type',
fixture: 'patch-commits',
expected: 'patch',
},
Expand All @@ -100,7 +100,7 @@ git rebase -i --root
expected: 'minor',
},
{
desc: 'with "docs", "style", "test" & "pr" commit type',
desc: 'with "docs", "style", "test", "ci" & "pr" commit type',
fixture: 'silent-commits',
expected: 'none',
},
Expand Down

0 comments on commit 96bd23a

Please sign in to comment.