-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
38 lines (36 loc) · 1.09 KB
/
lefthook.yml
File metadata and controls
38 lines (36 loc) · 1.09 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
# Lefthook configuration for git hooks
# Source: https://github.com/evilmartians/lefthook
pre-commit:
parallel: false
commands:
ruff-format:
glob: "backend/**/*.py"
root: "backend/"
run: uv run ruff format {staged_files}
stage_fixed: true
ruff-check:
glob: "backend/**/*.py"
root: "backend/"
run: uv run ruff check {staged_files}
eslint:
glob: "frontend/**/*.{js,ts,tsx}"
root: "frontend/"
run: npx eslint {staged_files}
prettier:
glob: "frontend/**/*.{js,ts,tsx,json,css,md}"
root: "frontend/"
run: npx prettier --check {staged_files}
pre-push:
commands:
backend-format-check:
run: cd backend && uv run ruff format --check .
backend-lint-check:
run: cd backend && uv run ruff check .
generate-types:
run: |
make generate-types
if [ -n "$(git status --porcelain packages/types/)" ]; then
echo "Type generation produced changes. Run 'make generate-types' and commit the results before pushing."
git diff -- packages/types/
exit 1
fi