-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (69 loc) · 2.16 KB
/
.pre-commit-config.yaml
File metadata and controls
75 lines (69 loc) · 2.16 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
repos:
# ------------------------
# General sanity checks
# ------------------------
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
# ------------------------
# Backend (Python / FastAPI)
# ------------------------
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff-check
name: ruff (lint)
args:
- --config=backend/pyproject.toml
- --fix
files: ^backend/.*\.py$
- id: ruff-format
name: ruff (format)
args:
- --config=backend/pyproject.toml
files: ^backend/.*\.py$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
name: mypy (type checking)
args:
- --config-file=backend/pyproject.toml
files: ^backend/.*\.py$
additional_dependencies:
- fastapi
- pydantic
- sqlalchemy
- types-python-dateutil
# ------------------------
# Frontend (Node / TS)
# NOTE: Git hooks run in a non-interactive shell. Node tooling (pnpm) must be available on PATH.
# ------------------------
- repo: local
hooks:
- id: frontend-eslint
name: Frontend ESLint (staged files)
entry: >
bash -c '
command -v pnpm >/dev/null 2>&1 ||
{ echo "❌ pnpm not found on PATH (git hooks run non-interactively)"; exit 1; };
export PATH="$HOME/.local/bin:$HOME/.pnpm:$PATH";
pnpm --dir frontend run lint:fix:staged
'
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx)$
- id: frontend-prettier
name: Frontend Prettier (staged files)
entry: >
bash -c '
command -v pnpm >/dev/null 2>&1 ||
{ echo "❌ pnpm not found on PATH (git hooks run non-interactively)"; exit 1; };
export PATH="$HOME/.local/bin:$HOME/.pnpm:$PATH";
pnpm --dir frontend run format:staged
'
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx|css|json|md)$