-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
140 lines (135 loc) · 4.43 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
140 lines (135 loc) · 4.43 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
minimum_pre_commit_version: "3.7.0"
default_install_hook_types:
- pre-commit
- pre-push
default_stages:
- pre-commit
exclude: >-
(?x)^(
\.claude/|
\.codex/|
\.git/|
\.omx/|
\.opencode/|
\.sisyphus/|
\.tmp-screens/|
backend/\.omc/|
backend/.*/__pycache__/|
frontend/\.omc/|
frontend/\.pnpm-store/|
frontend/dist/|
frontend/node_modules/|
frontend/playwright-report/|
frontend/test-results/|
tmp_repos/
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements
files: ^backend/.*\.py$
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- id: check-added-large-files
args: [--maxkb=500]
- id: name-tests-test
args: [--pytest-test-first]
files: ^backend/tests/(?!.*(?:factories|__init__)\.py$).*\.py$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.6
hooks:
- id: ruff-check
files: ^backend/.*\.py$
- id: ruff-format
args: [--check]
files: ^backend/.*\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
hooks:
- id: bandit
name: bandit (backend full scan)
args:
[
"-c",
"backend/pyproject.toml",
"-r",
"backend/apps",
"backend/config",
]
additional_dependencies: ["bandit[toml]"]
pass_filenames: false
always_run: true
stages: [pre-push]
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args:
[
"--baseline",
".secrets.baseline",
"--exclude-files",
"(^\\.env\\.example$|^\\.sisyphus/|^backend/\\.omc/|^frontend/pnpm-lock\\.yaml$|^pnpm-lock\\.yaml$|^backend/tests/|^docker-compose\\.yml$)",
]
- repo: local
hooks:
- id: frontend-eslint
name: eslint (frontend staged files)
entry: python3 scripts/run_frontend_eslint.py
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx)$
- id: frontend-prettier
name: prettier (staged files)
entry: pnpm exec prettier --check
language: system
files: ^(frontend/.*\.(ts|tsx|js|jsx|json|css|md|ya?ml)|docs/.*\.md|package\.json|pnpm-lock\.yaml|frontend/package\.json|frontend/pnpm-lock\.yaml|\.prettierrc\.json|\.pre-commit-config\.yaml)$
- id: frontend-eslint-full
name: eslint (frontend full scan)
entry: pnpm --dir frontend run lint
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: frontend-typecheck
name: typescript (frontend full scan)
entry: pnpm --dir frontend run typecheck
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: backend-ruff-full
name: ruff (backend full scan)
entry: uv run --project backend --extra dev ruff check backend --select F63,F7,F82,E9
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: backend-mypy
name: mypy (backend gradual typed modules)
entry: uv run --project backend --extra dev mypy backend/apps/generation/providers/base.py backend/apps/generation/providers/anthropic_provider.py backend/apps/generation/providers/gemini_provider.py backend/apps/generation/providers/openai_provider.py backend/apps/generation/providers/openrouter_provider.py backend/apps/generation/providers/registry.py
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: backend-import-linter
name: import-linter (backend architecture)
entry: bash -c 'cd backend && PYTHONPATH=. uv run lint-imports'
language: system
pass_filenames: false
always_run: true
stages: [pre-push]
- id: backend-django-check
name: Django system check (test settings)
entry: bash -c 'cd backend && DJANGO_SETTINGS_MODULE=config.settings.test PYTHONPATH=. uv run python manage.py check'
language: system
pass_filenames: false
always_run: true
stages: [pre-push]