47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
# Run `pre-commit install` after cloning. CI should run `pre-commit run --all-files`.
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: check-yaml
|
|
- id: check-json
|
|
- id: check-added-large-files
|
|
args: ["--maxkb=512"]
|
|
- id: detect-private-key
|
|
|
|
# Backend — ruff (lint + format)
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.4.10
|
|
hooks:
|
|
- id: ruff
|
|
args: ["--fix"]
|
|
files: ^backend/.*\.py$
|
|
- id: ruff-format
|
|
files: ^backend/.*\.py$
|
|
|
|
# Frontend — eslint + tsc via local hooks (must be run from frontend/)
|
|
- repo: local
|
|
hooks:
|
|
- id: eslint
|
|
name: eslint (frontend)
|
|
entry: bash -c 'cd frontend && npm run lint'
|
|
language: system
|
|
files: ^frontend/.*\.(ts|tsx)$
|
|
pass_filenames: false
|
|
|
|
- id: tsc-noemit
|
|
name: tsc --noEmit (frontend)
|
|
entry: bash -c 'cd frontend && npm run typecheck'
|
|
language: system
|
|
files: ^frontend/.*\.(ts|tsx)$
|
|
pass_filenames: false
|
|
|
|
- id: prettier
|
|
name: prettier --check (frontend)
|
|
entry: bash -c 'cd frontend && npm run format:check'
|
|
language: system
|
|
files: ^frontend/.*\.(ts|tsx|css|json|html)$
|
|
pass_filenames: false
|