Skip to content

Commit

Permalink
feat: add commitlint and husky
Browse files Browse the repository at this point in the history
  • Loading branch information
18003228289 committed Apr 8, 2024
1 parent ef5e6d3 commit c6c3b87
Show file tree
Hide file tree
Showing 6 changed files with 8,286 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
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
32 changes: 32 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'], // body 开始于空白行
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108], // header 字符最大长度为 108
'subject-empty': [2, 'never'], // subject 不为空
'type-empty': [2, 'never'], // type 不为空
'subject-case': [0],
'type-enum': [
2,
'always',
[
'feat', // 增加新功能
'fix', // 修复问题/BUG
'perf', // 优化/性能提升
'style', // 代码风格相关无影响运行结果的
'docs', // 文档/注释
'test', // 测试相关
'refactor', // 重构
'build', // 对构建系统或者外部依赖项进行了修改
'ci', // 对 CI 配置文件或脚本进行了修改
'chore', // 依赖更新/脚手架配置修改等
'revert', // 撤销修改
'wip', // 开发中
'workflow', // 工作流改进
'types', // 类型修改
'release',
],
],
},
};
2 changes: 1 addition & 1 deletion example/dubbo-node-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/dubbo-web-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c6c3b87

Please sign in to comment.