-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathlefthook.yml
More file actions
45 lines (39 loc) · 1.46 KB
/
lefthook.yml
File metadata and controls
45 lines (39 loc) · 1.46 KB
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
pre-commit:
parallel: true
commands:
biome-lint:
glob: "libs/client/**/*.{ts,tsx,js,jsx,mjs}"
run: npx biome check --no-errors-on-unmatched {staged_files}
rescript-format:
glob: "**/*.{res,resi}"
run: npx rescript format --check {staged_files}
elixir-format-server:
root: "apps/frontman_server/"
glob: "apps/frontman_server/**/*.{ex,exs}"
run: mix format --check-formatted {staged_files}
elixir-format-swarm:
root: "apps/swarm_ai/"
glob: "apps/swarm_ai/**/*.{ex,exs}"
run: mix format --check-formatted {staged_files}
elixir-credo-server:
root: "apps/frontman_server/"
glob: "apps/frontman_server/**/*.{ex,exs}"
run: mix credo --strict {staged_files}
elixir-credo-swarm:
root: "apps/swarm_ai/"
glob: "apps/swarm_ai/**/*.{ex,exs}"
run: mix credo --strict {staged_files}
pre-push:
commands:
reanalyze:
glob: "libs/**/*.res"
run: |
for lib in bindings client experimental-rescript-webapi frontman-astro frontman-astro-browser frontman-client frontman-core frontman-nextjs frontman-protocol frontman-vite logs react-statestore; do
echo "=== $lib ==="
output=$(cd libs/$lib && npx @rescript/tools@0.6.6 reanalyze -config 2>&1)
echo "$output"
if ! echo "$output" | grep -q "Analysis reported 0 issues"; then
echo "Dead code detected in libs/$lib"
exit 1
fi
done