Skip to content

Commit ae9f840

Browse files
authored
feat(ci-cd): commitizen added (#48)
* feat(ci-cd): added commitizen GH-0 * feat(ci-cd): added commitizen GH-0
1 parent ddac8fd commit ae9f840

File tree

9 files changed

+4989
-87
lines changed

9 files changed

+4989
-87
lines changed

.cz-config.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
module.exports = {
2+
types: [
3+
{value: 'feat', name: 'feat: A new feature'},
4+
{value: 'fix', name: 'fix: A bug fix'},
5+
{value: 'docs', name: 'docs: Documentation only changes'},
6+
{
7+
value: 'style',
8+
name:
9+
'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)',
10+
},
11+
{
12+
value: 'refactor',
13+
name:
14+
'refactor: A code change that neither fixes a bug nor adds a feature',
15+
},
16+
{
17+
value: 'perf',
18+
name: 'perf: A code change that improves performance',
19+
},
20+
{value: 'test', name: 'test: Adding missing tests'},
21+
{
22+
value: 'chore',
23+
name:
24+
'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation',
25+
},
26+
{value: 'revert', name: 'revert: Reverting a commit'},
27+
{value: 'WIP', name: 'WIP: Work in progress'},
28+
],
29+
30+
scopes: [
31+
{name: 'chore'},
32+
{name: 'ci-cd'},
33+
{name: 'component'},
34+
{name: 'provider'},
35+
{name: 'core'},
36+
],
37+
38+
appendBranchNameToCommitMessage: true,
39+
appendIssueFromBranchName: true,
40+
allowTicketNumber: false,
41+
isTicketNumberRequired: false,
42+
43+
// override the messages, defaults are as follows
44+
messages: {
45+
type: "Select the type of change that you're committing:",
46+
scope: 'Denote the SCOPE of this change:',
47+
// used if allowCustomScopes is true
48+
customScope: 'Denote the SCOPE of this change:',
49+
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
50+
body:
51+
'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
52+
breaking: 'List any BREAKING CHANGES (optional):\n',
53+
footer: 'List any ISSUES CLOSED by this change (optional). E.g.: GH-144:\n',
54+
confirmCommit: 'Are you sure you want to proceed with the commit above?',
55+
},
56+
57+
allowCustomScopes: false,
58+
allowBreakingChanges: ['feat', 'fix'],
59+
60+
// limit subject length
61+
subjectLimit: 100,
62+
breaklineChar: '|', // It is supported for fields body and footer.
63+
footerPrefix: '',
64+
askForBreakingChangeFirst: true, // default is false
65+
};

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ coverage/
44
api-docs/
55

66
index.*
7+
.cz-config.js
8+
commitlint.config.js

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm test

.husky/prepare-commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
exec < /dev/tty && npx cz --hook || true

DEVELOPING.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ users.
77

88
Install the following extensions:
99

10-
- [tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint)
11-
- [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
10+
- [tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint)
11+
- [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
12+
13+
## Setup Commit Hooks
14+
15+
Run the following script to prepare husky after the first time install -
16+
17+
`npm run prepare`
1218

1319
## Development workflow
1420

commitlint.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'header-max-length': [2, 'always', 100],
5+
'body-leading-blank': [2, 'always'],
6+
'footer-leading-blank': [0, 'always'],
7+
'references-empty': [2, 'never'],
8+
},
9+
parserPreset: {
10+
parserOpts: {
11+
issuePrefixes: ['GH-'],
12+
},
13+
},
14+
};

0 commit comments

Comments
 (0)