-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps: add commitlint & husky & lint-staged
- Loading branch information
1 parent
acfd6ce
commit 67c3a8c
Showing
5 changed files
with
1,906 additions
and
15 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,75 @@ | ||
module.exports = { | ||
types: [ | ||
{ | ||
value: "chore", | ||
name: "🎨 chore: 除定义类型之外的代码修改", | ||
}, | ||
{ | ||
value: "feat", | ||
name: "✨ feat(CR): 新增功能或特性", | ||
}, | ||
{ | ||
value: "fix", | ||
name: "🐛 fix(CR): 修复 Bug 缺陷", | ||
}, | ||
{ | ||
value: "perf", | ||
name: "⚡️ perf(CR): 提高代码性能的变更", | ||
}, | ||
{ | ||
value: "refactor", | ||
name: "🔨 refactor(CR): 功能逻辑较大的重构", | ||
}, | ||
{ | ||
value: "revert", | ||
name: "🗑 revert(CR): 代码回退操作", | ||
}, | ||
{ | ||
value: "docs", | ||
name: "📝 docs: 文档类的更新", | ||
}, | ||
{ | ||
value: "ci", | ||
name: "👷 ci: 持续集成类调整", | ||
}, | ||
{ | ||
value: "wip", | ||
name: "🚧 wip: 半成品", | ||
}, | ||
{ | ||
value: "workflow", | ||
name: "⚙️ workflow: 工作流调整", | ||
}, | ||
{ | ||
value: "deps", | ||
name: "⬆️ deps: 依赖更改", | ||
}, | ||
{ | ||
value: "test", | ||
name: "✅ test: 新增测试用例或是更新现有测试用例", | ||
}, | ||
{ | ||
value: "build", | ||
name: "🚀 build: 编译构建类的代码调整", | ||
}, | ||
{ | ||
value: "style", | ||
name: "💄 style: 代码格式化", | ||
}, | ||
], | ||
scopes: [], | ||
messages: { | ||
type: "请选择提交类型:", | ||
scope: "请选择一个影响范围 (可选):", | ||
customScope: "请输入本次修改影响范围(可选):", | ||
subject: "请简述本次提交行为(必填,动词前置):", | ||
body: "请输入详细描述(可选):", | ||
breaking: "非兼容性说明 (可选):\n", | ||
footer: "关联关闭的issue,例如:#31, #34(可选):\n", | ||
confirmCommit: "确认按照规范填写了以上内容?(y/n)", | ||
}, | ||
allowCustomScopes: true, | ||
skipQuestions: ["body", "footer"], | ||
allowBreakingChanges: ["feat", "refactor"], | ||
subjectLimit: 256, | ||
}; |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "$1" |
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,30 @@ | ||
module.exports = { | ||
extends: ["@commitlint/config-conventional"], | ||
rules: { | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"feat", | ||
"fix", | ||
"docs", | ||
"style", | ||
"refactor", | ||
"perf", | ||
"test", | ||
"chore", | ||
"wip", | ||
"workflow", | ||
"revert", | ||
"build", | ||
"ci", | ||
"deps", | ||
], | ||
], | ||
"type-case": [0], | ||
"subject-case": [0], | ||
"body-max-length": [0, "always", 256], | ||
"header-max-length": [0, "always", 256], | ||
"body-max-line-length": [0, "always", 256], | ||
}, | ||
}; |
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
Oops, something went wrong.