Repository navigation
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
66 lines (61 loc) · 2.11 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
66 lines (61 loc) · 2.11 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
# Pre-commit hooks for fast local feedback. CI is the authoritative gate
# (see .github/workflows/lint.yml); these hooks run the same tools so issues
# surface at commit time instead of on PR.
#
# Setup (one-time, on the host):
# pip install pre-commit
# pre-commit install
#
# After that, every `git commit` runs the hooks below against staged files.
# To run all hooks against the entire tree manually: `pre-commit run -a`.
default_language_version:
python: python3.13
node: system
repos:
# File-shape hygiene. These are pre-commit's own hooks, applied to every
# text file regardless of language.
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-yaml
exclude: ^\.github/
- id: check-toml
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
# Backend: ruff replaces black + flake8 + isort. Two separate hooks so the
# check (lint) and format passes show as distinct commit-blockers.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
- id: ruff-check
args: [--fix]
files: ^backend/.*\.py$
- id: ruff-format
files: ^backend/.*\.py$
# Frontend: prettier handles formatting (TS/TSX/JS/JSON/CSS).
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.8.3
hooks:
- id: prettier
files: ^frontend/.*\.(ts|tsx|js|jsx|json|css)$
# Frontend: eslint and stylelint use local hooks so they pick up the
# project's installed versions (not a frozen pre-commit mirror that would
# drift from package.json).
- repo: local
hooks:
- id: eslint
name: eslint
language: node
entry: bash -c 'cd frontend && npx eslint .'
files: ^frontend/.*\.(ts|tsx|js|jsx|mjs)$
pass_filenames: false
- id: stylelint
name: stylelint
language: node
entry: bash -c 'cd frontend && npx stylelint "src/**/*.{css,module.css}"'
files: ^frontend/src/.*\.(css|module\.css)$
pass_filenames: false