-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlefthook.yml
129 lines (119 loc) · 3.87 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
assert_lefthook_installed: true
colors: true
no_tty: false
min_version: 1.5.0
pre-install:
commands:
validate:
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/pre-install.cjs"
prepare:
commands:
validate:
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/prepare.cjs"
pre-commit:
# piped: true
commands:
prepare:
glob: "**/{lefthook.yml,biome.json}"
run: "pnpm lefthook install"
stage_fixed: true
schema-gen:
glob: "packages/config/src/schema.ts"
run: 'pnpm nx generate @storm-software/workspace-tools:config-schema
--outputFile="./packages/config/schemas/storm.schema.json"'
stage_fixed: true
validate:
files: "git diff --name-only HEAD @{push}"
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/pre-commit.cjs {files}"
stage_fixed: true
# lint:
# files: "git diff --name-only HEAD @{push}"
# glob: "**/*.{js,ts,rs,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
# run: "pnpm lint"
# stage_fixed: true
lint-codeowners:
files: "git diff --name-only HEAD @{push}"
glob: "**/CODEOWNERS"
run: "pnpm node ./dist/packages/linting-tools/bin/lint.js
codeowners"
# check:
# files: "git diff --name-only HEAD @{push}"
# glob: "**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
# run: "pnpm exec prettier {staged_files} --check --ignore-unknown --no-error-on-unmatched-pattern --cache"
# format:
# files: "git diff --name-only HEAD @{push}"
# glob: "**/*"
# exclude: "packages/workspace-tools/src/generators/*/files/**/*"
# run: "pnpm exec prettier {files} --write --ignore-unknown
# --no-error-on-unmatched-pattern --cache"
# stage_fixed: true
commit-msg:
commands:
validate:
run: "pnpm node ./dist/packages/git-tools/bin/git.cjs
commitlint --message {1}"
pre-push:
piped: true
commands:
build:
glob: "**/*"
run: "pnpm build-plugins && nx affected -t build --parallel=2"
stage_fixed: true
validate:
files: "git diff --name-only HEAD @{push}"
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/pre-push.cjs {files}"
stage_fixed: true
lint-github-actions:
glob: ".github/workflows/*.*"
run: 'zizmor --offline --config="./dist/packages/linting-tools/zizmor/config.yml" .github/workflows/'
toml:
files: "git diff --name-only HEAD @{push}"
glob: "**/*.{toml}"
run: "pnpm format-toml"
stage_fixed: true
readme:
glob: "**/{README.md,README.*.md,readme/**/*,package.json,executors.json,generators.json}"
run: "pnpm format-readme"
stage_fixed: true
prettier:
files: "git diff --name-only HEAD @{push}"
glob: "!packages/workspace-tools/src/generators/*/files/**/*"
run: "pnpm exec prettier {files} --write --ignore-unknown
--no-error-on-unmatched-pattern --cache"
stage_fixed: true
sherif:
files: "git diff --name-only HEAD @{push}"
glob: "**/*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: "pnpm format-sherif"
stage_fixed: true
format:
glob: "**/*"
run: "pnpm format"
stage_fixed: true
post-merge:
commands:
validate:
files: "git diff --name-only HEAD @{push}"
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/post-merge.cjs {files}"
stage_fixed: true
post-checkout:
commands:
validate:
files: "git diff --name-only HEAD @{push}"
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/post-checkout.cjs {files}"
post-commit:
commands:
validate:
files: "git diff --name-only HEAD @{push}"
glob: "**/*"
run: "node ./dist/packages/git-tools/bin/post-commit.cjs {files}"