-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
85 lines (76 loc) · 2.6 KB
/
.pre-commit-config.yaml
File metadata and controls
85 lines (76 loc) · 2.6 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
# Pre-commit hooks for code quality enforcement
# Install: pip install pre-commit && pre-commit install
exclude: ^uv\.lock$
repos:
# Import validation - Catch circular imports and missing dependencies
# - repo: local
# hooks:
# - id: test-imports
# name: test imports
# entry: bash -c 'uv run python scripts/test_imports.py "$@"' --
# language: system
# types: [python]
# files: \.py$
# pass_filenames: true
# Migration linting - Detect dangerous database operations
- repo: local
hooks:
- id: lint-migrations
name: Lint Aerich Migrations
entry: uv run python scripts/lint-migrations.py
language: system
pass_filenames: false
files: ^migrations/models/.*\.py$
# Pylint - Comprehensive linting with configured limits
- repo: local
hooks:
- id: pylint
name: pylint
entry: uv run pylint
language: system
types: [python]
files: \.py$
exclude: ^(migrations|tests|scripts)/
# Basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^seer-frontend/
- id: end-of-file-fixer
exclude: ^seer-frontend/
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: forbid-new-submodules
# Block .pylintrc (use pyproject.toml instead)
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: text-unicode-replacement-char
# Block eval data from being committed (contains PII / is gitignored)
- repo: local
hooks:
- id: forbid-eval-data
name: Forbid eval data files (PII / gitignored)
entry: "Eval data files must not be committed (contains PII). See .gitignore."
language: fail
files: ^tests/eval/nexus/(raw_sessions|ground_truth)\.json$|^tests/eval/baselines/.*\.json$
- repo: local
hooks:
- id: forbid-pylintrc
name: Forbid .pylintrc (use pyproject.toml)
entry: .pylintrc is forbidden - use pyproject.toml for pylint config
language: fail
files: ^\.pylintrc$
# Frontend linting via lint-staged (ESLint + Prettier)
- repo: local
hooks:
- id: frontend-lint-staged
name: Frontend lint-staged (ESLint + Prettier)
entry: bash -c 'cd seer-frontend && PATH="./node_modules/.bin:$PATH" npx lint-staged'
language: system
files: ^seer-frontend/.*\.(ts|tsx|css|json|md|html)$
pass_filenames: false