-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
56 lines (52 loc) · 1.85 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
56 lines (52 loc) · 1.85 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
# .pre-commit-config.yaml
# Monorepo structure: backend/ and frontend/ directories
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: check-merge-conflict
# Python linting for backend
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff-format
args: ["--config=backend/pyproject.toml"]
files: ^backend/.*\.py$
exclude: '\.backup\.py$'
- id: ruff
args: ["--fix", "--config=backend/pyproject.toml"]
files: ^backend/.*\.py$
exclude: '\.backup\.py$'
# Python type checking for backend
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
args: [--ignore-missing-imports]
files: ^backend/src/service/
additional_dependencies: ["sqlalchemy", "pydantic"]
types: [python]
# Frontend code quality (using local tools)
- repo: local
hooks:
# Prettier formatting for frontend
- id: prettier-frontend
name: prettier (frontend)
entry: bash -c 'cd frontend && for file in "$@"; do node_modules/.bin/prettier --write "${file#frontend/}"; done' --
language: system
files: ^frontend/.*\.(js|svelte|json|css|html)$
exclude: ^frontend/(node_modules|dist|build)/
pass_filenames: true
# ESLint for frontend JavaScript/Svelte
- id: eslint-frontend
name: eslint (frontend)
entry: bash -c 'cd frontend && for file in "$@"; do node_modules/.bin/eslint "${file#frontend/}"; done' --
language: system
files: ^frontend/.*\.(js|svelte)$
exclude: ^frontend/(node_modules|dist|build)/
pass_filenames: true