Skip to content

Commit 8aa7796

Browse files
committed
ci: 添加 lefthook 配置文件
- 新增 lefthook.yml 文件,用于配置 pre-commit 和 commit-msg 钩子 - pre-commit 钩子中添加 eslint 检查,对所有文件进行代码风格检查和自动修复 - commit-msg 钩子中添加 commitlint 检查,确保提交信息符合规范
1 parent 179e5c2 commit 8aa7796

File tree

3 files changed

+171
-558
lines changed

3 files changed

+171
-558
lines changed

lefthook.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# @file lefthook.yml
2+
# @ref https://evilmartians.github.io/lefthook/
3+
4+
pre-commit:
5+
parallel: true
6+
commands:
7+
eslint:
8+
glob: '*'
9+
run: npx eslint --no-error-on-unmatched-pattern --no-color --fix {staged_files}
10+
stage_fixed: true
11+
12+
commit-msg:
13+
parallel: true
14+
commands:
15+
commitlint:
16+
run: npx commitlint --edit

0 commit comments

Comments
 (0)