forked from eneo-ai/eneo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
69 lines (64 loc) · 2.34 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
69 lines (64 loc) · 2.34 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
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.3
hooks:
# Lint using project configuration (pyproject.toml)
- id: ruff-check
name: ruff
args: [--fix]
stages: [pre-commit]
files: ^backend/
# Auto-format Python with ruff format (Python equivalent of prettier).
# Alembic migrations are excluded — they are historical artifacts that
# should not change after being deployed (whitespace churn breaks
# git blame / bisect on schema history).
- id: ruff-format
name: ruff-format
stages: [pre-commit]
files: ^backend/.*\.py$
exclude: ^backend/alembic/
# Pyright type checking via devcontainer
- repo: local
hooks:
- id: pyright
name: pyright
entry: bash backend/scripts/run_pyright_in_devcontainer.sh
language: system
types: [python]
files: ^backend/src/intric/
pass_filenames: false
stages: [pre-commit]
# Keep uv.lock in sync with pyproject.toml
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.8.22
hooks:
- id: uv-lock
args: [--directory, backend]
# Frontend: auto-format changed files with prettier (writes changes back and re-stages)
- repo: local
hooks:
- id: frontend-format
name: frontend-format
entry: bash -c 'cd frontend && bunx --bun prettier --write --ignore-unknown "${@/#frontend\//}"' --
language: system
files: ^frontend/(apps|packages)/[^/]+/.*\.(svelte|ts|tsx|js|jsx|css|scss|json|md|yaml|yml|html)$
exclude: ^frontend/[^/]+/[^/]+/(\.svelte-kit|node_modules|build|dist)/
stages: [pre-commit]
# Frontend: lint changed Svelte/TS/JS files
- repo: local
hooks:
- id: frontend-lint
name: frontend-lint
entry: bash -c 'cd frontend/apps/web && bunx eslint --no-warn-ignored "${@/#frontend\/apps\/web\//}"' --
language: system
files: ^frontend/apps/web/src/.*\.(svelte|ts|js)$
stages: [pre-commit]
# Prevent duplicate keys in i18n message files
- repo: local
hooks:
- id: i18n-no-duplicate-keys
name: i18n-no-duplicate-keys
entry: python3 frontend/apps/web/scripts/check-i18n-duplicates.py
language: system
files: ^frontend/apps/web/messages/.*\.json$
pass_filenames: false