-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
62 lines (57 loc) · 1.92 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
62 lines (57 loc) · 1.92 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
# Python - Ruff linter and formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--fix]
files: ^src/backend/
- id: ruff-format
files: ^src/backend/
# Frontend - ESLint
- repo: local
hooks:
- id: eslint
name: eslint
entry: bash -c 'cd src/frontend && yarn lint:fix'
language: system
files: ^src/frontend/src/.*\.(ts|tsx)$
pass_filenames: false
# Frontend - Prettier
- repo: local
hooks:
- id: prettier
name: prettier
entry: bash -c 'cd src/frontend && yarn format'
language: system
files: ^src/frontend/src/.*\.(ts|tsx|css)$
pass_filenames: false
# Frontend - TypeScript Type Check
- repo: local
hooks:
- id: typescript
name: typescript
entry: bash -c 'cd src/frontend && yarn type-check'
language: system
files: ^src/frontend/src/.*\.(ts|tsx)$
pass_filenames: false
# Requirements lockfile sync check
- repo: local
hooks:
- id: check-requirements-lock
name: check-requirements-lock
entry: bash -c 'if git diff --cached --name-only | grep -q "requirements\.in$"; then if ! git diff --cached --name-only | grep -q "requirements\.txt$"; then echo "ERROR: requirements.in changed but requirements.txt was not updated." && echo "Run ./scripts/lock-requirements.sh and stage the updated .txt files." && exit 1; fi; fi'
language: system
files: requirements\.(in|txt)$
pass_filenames: false