-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
71 lines (63 loc) · 2.64 KB
/
.pre-commit-config.yaml
File metadata and controls
71 lines (63 loc) · 2.64 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
# Pre-commit hooks configuration
# Install: uv tool install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
repos:
# Local hooks using uv run to match CI exactly
- repo: local
hooks:
# Ruff format - auto-fix formatting
- id: ruff-format-backend
name: ruff format (backend)
entry: bash -c 'cd backend && uv run ruff format --config pyproject.toml .'
language: system
files: ^backend/.*\.py$
pass_filenames: false
# Ruff check - auto-fix safe lint issues (import sorting, etc.)
- id: ruff-backend
name: ruff check (backend)
entry: bash -c 'cd backend && uv run ruff check --fix --config pyproject.toml .'
language: system
files: ^backend/.*\.py$
pass_filenames: false
# MyPy - matches CI: cd backend && uv run mypy --config-file pyproject.toml --strict .
- id: mypy-backend
name: mypy --strict (backend)
entry: bash -c 'cd backend && uv run mypy --config-file pyproject.toml --strict .'
language: system
files: ^backend/.*\.py$
pass_filenames: false
# Grimp - matches CI: cd backend && uv run python scripts/check_orphan_modules.py
- id: grimp-backend
name: grimp orphan modules (backend)
entry: bash -c 'cd backend && uv run python scripts/check_orphan_modules.py'
language: system
files: ^backend/.*\.py$
pass_filenames: false
# ESLint - matches CI: cd frontend && npx eslint src
- id: eslint-frontend
name: eslint (frontend)
entry: bash -c 'cd frontend && npx eslint src'
language: system
files: ^frontend/src/.*\.(ts|svelte)$
pass_filenames: false
# Stylelint - matches CI: cd frontend && npx stylelint "src/**/*.css"
- id: stylelint-frontend
name: stylelint (frontend)
entry: bash -c 'cd frontend && npx stylelint "src/**/*.css"'
language: system
files: ^frontend/src/.*\.css$
pass_filenames: false
# Prettier - auto-fix formatting
- id: prettier-frontend
name: prettier (frontend)
entry: bash -c 'cd frontend && npx prettier --write "src/**/*.{ts,svelte,json}"'
language: system
files: ^frontend/src/.*\.(ts|svelte|json)$
pass_filenames: false
# Svelte Check - matches CI: cd frontend && npx svelte-check
- id: svelte-check-frontend
name: svelte-check (frontend)
entry: bash -c 'cd frontend && npx svelte-check --tsconfig ./tsconfig.json --fail-on-warnings'
language: system
files: ^frontend/src/.*\.(ts|svelte)$
pass_filenames: false