-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathlefthook.yml
More file actions
39 lines (34 loc) · 1.11 KB
/
Copy pathlefthook.yml
File metadata and controls
39 lines (34 loc) · 1.11 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
# Lefthook pre-commit hooks.
# Setup: `lefthook install` once after cloning.
# https://lefthook.dev
pre-commit:
parallel: true
commands:
backend-fmt:
root: "backend/"
glob: "*.rs"
# mise exec — lefthook spawns a fresh shell that doesn't pick up mise's
# shim-PATH, so we explicitly route through mise to find cargo.
run: mise exec -- cargo fmt --all -- --check
backend-clippy:
root: "backend/"
glob: "*.rs"
run: mise exec -- cargo clippy --all-targets --quiet -- -D warnings
devvit-app-biome:
root: "devvit-app/"
glob: "*.{js,ts,jsx,tsx,json,jsonc}"
run: pnpm exec biome check --no-errors-on-unmatched .
website-biome:
root: "website/"
glob: "*.{js,ts,jsx,tsx,json,jsonc,astro}"
run: pnpm exec biome check --no-errors-on-unmatched .
commit-msg:
commands:
# Soft check — warn on empty commit messages. {1} is lefthook's placeholder
# for the commit-msg file path (not $1).
not-empty:
run: |
if ! grep -qE "[A-Za-z]" "{1}"; then
echo "Empty commit message"
exit 1
fi