-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
51 lines (47 loc) · 1.35 KB
/
.pre-commit-config.yaml
File metadata and controls
51 lines (47 loc) · 1.35 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
repos:
# 1. Ensure updated dependencies
# uv
- repo: local
hooks:
- id: uv-sync
name: Sync dependencies with uv
entry: uv sync
language: system
pass_filenames: false
require_serial: true
# 2. Non-Python formatting (Prettier) — before any linters read those files
# Prettier
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.8.3
hooks:
- id: prettier
types_or: [scss, css, javascript, json, yaml, markdown]
exclude: |
(?x)^(
.*/vendor/.*
)$
# 3. Python formatting before linting — linter sees already-formatted code
# Ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.11
hooks:
- id: ruff-format
- id: ruff-check
args: [--fix]
# 4. Django template formatting then linting
# djLint: https://djlint.com/docs/integrations/#pre-commit
- repo: https://github.com/djlint/djLint
rev: v1.36.4
hooks:
- id: djlint-reformat-django
- id: djlint-django
# 5. Type checking last — needs clean, linted code to be meaningful
# ty : https://github.com/astral-sh/ty/issues/269
- repo: local
hooks:
- id: ty-check
name: Type check with ty
entry: uv run ty check
language: system
pass_filenames: false
require_serial: true