Commit f077e999 by liguokang

feat: 🎨

parent bca69f4e
...@@ -2,30 +2,31 @@ ...@@ -2,30 +2,31 @@
* @Author: liguokang * @Author: liguokang
* @Date: 2021-07-28 14:33:40 * @Date: 2021-07-28 14:33:40
* @LastEditors: liguokang * @LastEditors: liguokang
* @LastEditTime: 2021-07-28 21:11:00 * @LastEditTime: 2021-07-29 14:03:28
* @Description: * @Description:
* @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有 * @Copyrigh: ©2021 杭州杰竞科技有限公司 版权所有
*/ */
/**
* feat:新增功能
* fix:bug 修复
* docs:文档更新
* style:不影响程序逻辑的代码修改(修改空白字符,格式缩进,补全缺失的分号等,没有改变代码逻辑)
* refactor:重构代码(既没有新增功能,也没有修复 bug)
* perf:性能, 体验优化
* test:新增测试用例或是更新现有测试
* build:主要目的是修改项目构建系统(例如 glup,webpack,rollup 的配置等)的提交
* ci:主要目的是修改项目继续集成流程(例如 Travis,Jenkins,GitLab CI,Circle等)的提交
* chore:不属于以上类型的其他类型,比如构建流程, 依赖管理
* revert:回滚某个更早之前的提交
*/
module.exports = { module.exports = {
extends: ['@commitlint/config-conventional'], extends: ['@commitlint/config-conventional'],
rules: { rules: {
'type-enum': [2, 'always', ['feat', 'feat1', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'revert']],
'subject-full-stop': [0, 'never'],
'subject-case': [0, 'never'], 'subject-case': [0, 'never'],
'type-enum': [ 'header-min-length': [2, 'always', 10],
1, 'header-max-length': [2, 'always', 30],
'always',
[
'build', // 构建
'ci', // ci
'chore', // Other changes that don't modify src or test files. 改变构建流程、或者增加依赖库、工具等
'docs', // Adds or alters documentation. 仅仅修改了文档,比如README, CHANGELOG, CONTRIBUTE等等
'feat', // Adds a new feature. 新增feature
'fix', // Solves a bug. 修复bug
'perf', // Improves performance. 优化相关,比如提升性能、体验
'refactor', // Rewrites code without feature, performance or bug changes. 代码重构,没有加新功能或者修复bug
'revert', // Reverts a previous commit. 回滚到上一个版本
'style', // Improves formatting, white-space. 仅仅修改了空格、格式缩进、逗号等等,不改变代码逻辑
'test', // Adds or modifies tests. 测试用例,包括单元测试、集成测试等
],
],
}, },
}; };
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
node hooks/commit-msg.js yarn commitlint --edit $1
...@@ -4,16 +4,17 @@ ...@@ -4,16 +4,17 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-06-05 14:59:14 * @Date: 2020-06-05 14:59:14
* @LastEditors: liguokang * @LastEditors: liguokang
* @LastEditTime: 2021-07-28 11:30:15 * @LastEditTime: 2021-07-29 13:37:55
* @Description: * @Description:
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
const fs = require('fs') const fs = require('fs')
console.log(process);
const [ const [
messageFile, messageFile,
commitType, commitType,
] = process.env.HUSKY_GIT_PARAMS.split(' '); ] = process.env.$1.split(' ');
if (commitType == null) { if (commitType == null) {
const currentMessage = fs.readFileSync(messageFile, 'utf8'); const currentMessage = fs.readFileSync(messageFile, 'utf8');
......
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment