Skip to content

Commit f01b846

Browse files
committed
chore: added Commitizen
ISSUES CLOSED: #10
1 parent c90e962 commit f01b846

File tree

3 files changed

+38
-17
lines changed

3 files changed

+38
-17
lines changed

.cz-config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @license Copyright 2017 Google Inc. All Rights Reserved.
3+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
4+
* use this file except in compliance with the License. You may obtain a copy of
5+
* the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
6+
* applicable law or agreed to in writing, software distributed under the
7+
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
8+
* OF ANY KIND, either express or implied. See the License for the specific
9+
* language governing permissions and limitations under the License.
10+
*/
11+
// Based on https://github.com/GoogleChrome/lighthouse/blob/master/.cz-config.js
12+
13+
module.exports = {
14+
allowCustomScopes: true,
15+
scopes: [],
16+
types: [
17+
{ value: "feat", name: "feat: A new feature" },
18+
{ value: "tests", name: "tests: Tests, jest, binTestCases, etc" },
19+
{ value: "docs", name: "docs: Documentation" },
20+
{ value: "misc", name: "misc: Other formats like tweaks and such" },
21+
{ value: "chore", name: "chore: Updating docs, linting, grunt tasks etc" },
22+
{ value: "fix", name: "fix: Bugfix"},
23+
{ value: "refactor", name: "refactor: Refactored the code"}
24+
]
25+
};
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
extends: ["cz"],
23
rules: {
34
'body-leading-blank': [1, 'always'],
45
'footer-leading-blank': [1, 'always'],
@@ -11,23 +12,8 @@ module.exports = {
1112
],
1213
'subject-empty': [2, 'never'],
1314
'subject-full-stop': [2, 'never', '.'],
15+
"subject-tense": [1, "always", ["present-imperative"]],
1416
'type-case': [2, 'always', 'lower-case'],
15-
'type-empty': [2, 'never'],
16-
'type-enum': [
17-
2,
18-
'always',
19-
[
20-
'chore',
21-
'ci',
22-
'docs',
23-
'feat',
24-
'fix',
25-
'perf',
26-
'refactor',
27-
'revert',
28-
'style',
29-
'test'
30-
]
31-
]
17+
'type-empty': [2, 'never']
3218
}
3319
};

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
"commitmsg": "commitlint -e $GIT_PARAMS",
1111
"changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile CHANGELOG.md --same-file"
1212
},
13+
"config": {
14+
"commitizen": {
15+
"path": "./node_modules/cz-customizable"
16+
},
17+
"cz-customizable": {
18+
"config": "./.cz-config.js"
19+
}
20+
},
1321
"dependencies": {
1422
"cross-spawn": "^6.0.5",
1523
"webpack-addons": "^1.1.5",
@@ -22,6 +30,8 @@
2230
"babel-eslint": "^8.2.1",
2331
"commitizen": "^2.9.6",
2432
"conventional-changelog-cli": "^1.3.15",
33+
"conventional-changelog-lint-config-cz": "^0.3.0",
34+
"cz-customizable": "^5.2.0",
2535
"eslint": "^4.18.1",
2636
"husky": "^0.14.3"
2737
}

0 commit comments

Comments
 (0)