-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
44 lines (39 loc) · 1.94 KB
/
lefthook.yml
File metadata and controls
44 lines (39 loc) · 1.94 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
# lefthook.yml
# Hooks run in parallel per stage; glob guards skip commands when no matching
# files are changed, keeping iteration fast without hardcoding paths.
# ── pre-commit ───────────────────────────────────────────────────────────────
# Fast, staged-file-scoped checks. Should complete in seconds.
pre-commit:
parallel: true
commands:
rust-fmt:
glob: "**/*.rs"
run: cargo fmt --check
fail_text: "Run `cargo fmt` to fix Rust formatting"
biome-check:
# Pass only staged files so biome checks the diff, not the whole tree.
# Generated files (api.gen.ts, gql.ts, routeTree.gen.ts) are gitignored
# and therefore never appear in staged_files.
glob: "**/*.{ts,tsx,js,mjs,cjs,astro}"
run: bun biome check {staged_files}
fail_text: "Run `bun run check:fix` to auto-fix"
# ── pre-push ─────────────────────────────────────────────────────────────────
# CI-equivalent checks. Each command is gated on its relevant file types so
# pushing a docs-only change doesn't wait on Rust compilation.
pre-push:
parallel: true
commands:
rust-clippy:
glob: "{**/*.rs,**/Cargo.toml,Cargo.lock,rust-toolchain.toml}"
run: cargo clippy --workspace --all-targets -- -D warnings
fail_text: "Fix Clippy warnings before pushing"
rust-test:
glob: "{**/*.rs,**/Cargo.toml,Cargo.lock}"
run: cargo test --workspace
fail_text: "Fix failing tests before pushing"
ts-full-check:
# Full biome check (respects biome.json includes/excludes) triggered by
# any JS/TS source or config change.
glob: "**/*.{ts,tsx,js,mjs,cjs,astro,json}"
run: bun run check
fail_text: "Run `bun run check:fix` to auto-fix"