-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathlefthook.yml
35 lines (34 loc) · 967 Bytes
/
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
assert_lefthook_installed: true
pre-commit:
parallel: true
commands:
backend-sqlx-prepare:
root: "backend/"
glob: "*.rs"
run: cargo sqlx prepare -- --all-targets --all-features && git add .sqlx
backend-formatter:
root: "backend/"
glob: "*.rs"
run: cargo fmt
stage_fixed: true
backend-linter:
root: "backend/"
glob: "*.rs"
run: cargo clippy --all-targets --all-features -- -D warnings
backend-openapi:
root: "backend/"
glob: "*.rs"
run: >
cargo run --package abacus --bin gen-openapi &&
git add openapi.json &&
cd ../frontend &&
npm run gen:openapi &&
git add lib/api/gen/openapi.ts
frontend-formatter:
root: "frontend/"
run: npx prettier --ignore-unknown --write {staged_files}
stage_fixed: true
frontend-linter:
root: "frontend/"
glob: "*.{ts,tsx}"
run: npm run lint {staged_files}