Skip to content

Commit 44d91da

Browse files
authored
Merge pull request #9 from analyticsjs/develop
chore: release next version
2 parents c372833 + dccad71 commit 44d91da

File tree

8 files changed

+657
-67
lines changed

8 files changed

+657
-67
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
es2021: true,
77
node: true,
88
},
9-
extends: ['prettier'],
9+
extends: ['eslint:recommended', 'prettier'],
1010
parserOptions: {
1111
ecmaVersion: 13,
1212
},

config.json

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,11 @@
11
{
22
"lang": "en",
3-
"authors": [
4-
"chengpeiquan"
5-
],
6-
"dateRange": [
7-
"2021-12-01",
8-
"2022-01-31"
9-
],
10-
"repos": [
11-
"D:\\Git\\git-commit-analytics"
12-
],
3+
"authors": ["chengpeiquan"],
4+
"dateRange": ["2021-12-01", "2022-01-31"],
5+
"repos": ["D:\\Git\\git-commit-analytics"],
136
"format": {
147
"git-commit-analytics": "Git Commit Analytics"
158
},
16-
"includes": [
17-
"feat",
18-
"fix",
19-
"docs",
20-
"style",
21-
"refactor",
22-
"test",
23-
"chore"
24-
],
25-
"excludes": [
26-
"typo",
27-
"backup",
28-
"progress"
29-
]
9+
"includes": ["feat", "fix", "docs", "style", "refactor", "test", "chore"],
10+
"excludes": ["typo", "backup", "progress"]
3011
}

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,20 @@
2121
"eslint": "^8.5.0",
2222
"eslint-config-prettier": "^8.3.0",
2323
"eslint-plugin-prettier": "^4.0.0",
24-
"prettier": "^2.5.1"
24+
"lint-staged": "11.1.2",
25+
"prettier": "^2.5.1",
26+
"yorkie": "^2.0.0"
2527
},
2628
"dependencies": {
2729
"dayjs": "^1.10.7"
30+
},
31+
"gitHooks": {
32+
"pre-commit": "lint-staged",
33+
"commit-msg": "node scripts/verifyCommit.js"
34+
},
35+
"lint-staged": {
36+
"*.js": [
37+
"prettier --write ."
38+
]
2839
}
2940
}

scripts/verifyCommit.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Invoked on the commit-msg git hook by yorkie.
2+
3+
const fs = require('fs')
4+
const msgPath = process.env.GIT_PARAMS
5+
const msg = fs.readFileSync(msgPath, 'utf-8').trim()
6+
7+
const commitRE =
8+
/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(\(.+\))?: .{1,50}/
9+
10+
if (!commitRE.test(msg)) {
11+
console.log()
12+
console.error(
13+
` ERROR invalid commit message format.\n\n
14+
Proper commit message format is required for automated changelog generation. Examples:\n\n
15+
feat(compiler): add 'comments' option\n
16+
fix(v-model): handle events on blur (close #28)\n\n
17+
See .github/commit-convention.md for more details.\n`
18+
)
19+
process.exit(1)
20+
}

src/config.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/libs/saveReport.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = function ({ result, isEN }) {
3636
// Categories that has been written
3737
const categories = []
3838

39-
list = repoResult[t]
39+
const list = repoResult[t]
4040
list.forEach((item, index) => {
4141
const { repo, category, msg } = item
4242

0 commit comments

Comments
 (0)