-
Notifications
You must be signed in to change notification settings - Fork 2
/
.lefthook.yaml
44 lines (43 loc) · 1.28 KB
/
.lefthook.yaml
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
pre-commit:
commands:
dprint:
priority: 1
glob: "*.{json,jsonc,md,yaml}"
env:
WRUN_ARGS_FILE: .lefthook/wrun-args-dprint.txt
run: wrun -- fmt {staged_files}
shellcheck:
priority: 1
glob: vault-token-helper-secret-tool
env:
WRUN_ARGS_FILE: .lefthook/wrun-args-shellcheck.txt
run: wrun -- --format=gcc {staged_files}
shfmt:
priority: 1
glob: vault-token-helper-secret-tool
env:
WRUN_ARGS_FILE: .lefthook/wrun-args-shfmt.txt
run: wrun -- --write --simplify {staged_files}
check for changes made by hooks:
run: |-
if test -n "${CI-}"; then
git diff --exit-code {staged_files}
else
git diff --quiet {staged_files}
fi
rc=$?
test $rc -eq 0 || echo "error: found files modified by hooks" >&2
exit $rc
update-tools:
commands:
dprint:
priority: 1
run: wrun generate github dprint >.lefthook/wrun-args-dprint.txt
dprint-plugins:
env:
WRUN_ARGS_FILE: .lefthook/wrun-args-dprint.txt
run: wrun -- config update
shellcheck:
run: wrun generate shellcheck >.lefthook/wrun-args-shellcheck.txt
shfmt:
run: wrun generate github mvdan sh --tool shfmt >.lefthook/wrun-args-shfmt.txt