-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add support for semantic-releasing and tests
- Loading branch information
Brett Uglow
committed
May 12, 2016
1 parent
ff5cd42
commit 38ba08e
Showing
7 changed files
with
143 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- 5.11.0 | ||
|
||
# Need to specify a GCC compiler now! | ||
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements | ||
env: | ||
- CXX=g++-4.8 | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 | ||
|
||
before_install: | ||
- npm prune | ||
- npm set progress=false | ||
|
||
install: | ||
- npm install --quiet | ||
- npm link | ||
|
||
before_script: | ||
|
||
script: | ||
- npm test | ||
|
||
after_success: | ||
- npm run semantic-release | ||
|
||
branches: | ||
except: | ||
- "/^v\\d+\\.\\d+\\.\\d+$/" | ||
|
||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# cz-customizable-ghooks | ||
Integrate cz-customizable config with ghooks | ||
|
||
Integrate cz-customizable config with ghooks to use a single configuration for commit message generation AND commit message hooks. | ||
|
||
## Prerequisites | ||
|
||
- git | ||
- Node >= 4.x | ||
- cz-customizable | ||
- ghooks | ||
|
||
Make sure you have a git repository (`git init`) BEFORE installing ghooks, otherwise you have to take extra steps if you install ghooks before running `git init`. | ||
|
||
## Usage | ||
|
||
``` | ||
npm i cz-customizable ghooks cz-customizable-ghooks | ||
``` | ||
|
||
Then configure your package.json: | ||
|
||
``` | ||
// inside package.json | ||
... | ||
"config": { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
"cz-customizable": { | ||
"config": "path/to/your/cz-customizable-rules.js" | ||
}, | ||
"ghooks": { | ||
"commit-msg": "./node_modules/cz-customizable-ghooks/index.js $2" | ||
} | ||
} | ||
... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
describe('cz-customizable-ghooks', () => { | ||
const rules = require('../index'); | ||
|
||
|
||
it('should have a validationMessage function', () => { | ||
expect(typeof rules.validateMessage).toEqual('function'); | ||
}); | ||
|
||
|
||
describe('with complete config', () => { | ||
//const fullConfig = require('../config/commitMessageConfig'); | ||
|
||
const testData = [ | ||
{msg: 'feat(a): valid type', expectedResult: true}, | ||
{msg: 'fe(bb): incorrect type', expectedResult: false}, | ||
{msg: 'fix(ccc): valid type', expectedResult: true} | ||
]; | ||
|
||
it('should accept commit messages which match the rules in the config', () => { | ||
testData.forEach(test => { | ||
expect(rules.validateMessage(test.msg)).toEqual(test.expectedResult); | ||
}); | ||
}); | ||
|
||
}); | ||
}); |
fyi: I have made the
cz-customizible
configuration option 2 deprecated: leoforfree/cz-customizable@6cea17f.This aligns with the next major version of Commitizen.
It means there will be only one way to configure
cz-customizible
in the future.