-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.pre-commit-config.yaml
98 lines (88 loc) · 2.53 KB
/
.pre-commit-config.yaml
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
# Pre-commit configuration with auto-fixing formatters and linting checks
repos:
# Basic file cleanups (will auto-fix)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
# Python formatters (will auto-fix)
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
files: ^django_backend/
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
files: ^django_backend/
args: ['--profile=black']
# Frontend formatters (will auto-fix)
- repo: local
hooks:
- id: prettier
name: prettier
entry: bash -c 'cd svelte_frontend && npm run format'
language: system
files: ^svelte_frontend/.*\.(js|ts|svelte|json|css|scss|md)$
pass_filenames: false
# Python linting (will block commit on error)
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
hooks:
- id: flake8
files: ^django_backend/
types: [python]
additional_dependencies: [flake8-bugbear]
# Frontend checks (will block commit on error)
- repo: local
hooks:
- id: svelte-check
name: svelte-check
entry: bash -c 'cd svelte_frontend && npm run check'
language: system
files: ^svelte_frontend/.*\.(js|ts|svelte)$
pass_filenames: false
- id: svelte-lint
name: svelte-lint
entry: bash -c 'cd svelte_frontend && npm run lint'
language: system
files: ^svelte_frontend/.*\.(js|ts|svelte)$
pass_filenames: false
# Commit message formatting
- repo: https://github.com/commitizen-tools/commitizen
rev: v1.17.0
hooks:
- id: commitizen
stages: [commit-msg]
# SvelteKit frontend checks (these will block commits if they fail)
- repo: local
hooks:
- id: svelte-check
name: svelte-check
entry: bash -c 'cd svelte_frontend && npm run check'
language: system
files: ^svelte_frontend/.*\.(js|ts|svelte)$
pass_filenames: false
stages: [pre-commit]
- id: svelte-lint
name: svelte-lint
entry: bash -c 'cd svelte_frontend && npm run lint'
language: system
files: ^svelte_frontend/.*\.(js|ts|svelte)$
stages: [pre-commit]
# Basic file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
stages: [pre-commit]
- id: end-of-file-fixer
stages: [pre-commit]
- id: check-yaml
stages: [pre-commit]
- id: check-added-large-files
stages: [pre-commit]