-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathlefthook.yml
45 lines (45 loc) · 1.18 KB
/
lefthook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
#
pre-commit:
piped: true
follow: true
commands:
staged:
priority: 1
run: echo {staged_files}
security:
priority: 2
run: gitleaks protect --staged --no-banner
# typescript:
# priority: 3
# glob: "*.{ts,tsx}"
# run: na tsc --noEmit
# biome:
# priority: 4
# glob: "*.{ts,tsx,js,jsx,json,jsonc,css}"
# run: na biome check --fix {staged_files} --reporter summary
# stage_fixed: true
test:
priority: 5
glob: "*.{ts,tsx,js,jsx}"
run: na jest --findRelatedTests {staged_files}
prettier: # Biome 尚不支持 markdown 文件
priority: 6
glob: "*.{md,mdx,html,htm,yaml,yml,scss}"
run: na prettier --write {staged_files}
stylelint: # Biome 尚不支持 scss 文件
priority: 7
glob: "*.{css,scss}"
run: na stylelint --fix {staged_files}