-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
33 lines (30 loc) · 1.29 KB
/
.pre-commit-config.yaml
File metadata and controls
33 lines (30 loc) · 1.29 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
# Pre-commit hooks for Montage — mirrors CI lint checks
# Setup: pip install pre-commit && pre-commit install
# Manual: pre-commit run --all-files
repos:
- repo: local
hooks:
# ── prettier --write on staged frontend/src/ files ──────
# CI runs "prettier --check src/" in frontend/; this auto-
# fixes so the check won't fail.
- id: prettier
name: prettier (frontend)
language: system
entry: bash -c 'cd frontend && npx prettier --write --ignore-unknown "${@#frontend/}"' --
files: ^frontend/src/.*\.(vue|js|jsx|cjs|mjs|css|json|md)$
exclude: ^frontend/src/i18n/
# ── eslint on staged frontend/src/ files ────────────────
- id: eslint
name: eslint (frontend)
language: system
entry: bash -c 'cd frontend && npx eslint "${@#frontend/}"' --
files: ^frontend/src/.*\.(vue|js|jsx|cjs|mjs)$
# ── ruff: syntax + undefined name check for Python ────────
# Catches SyntaxError, undefined names (F821), and other
# fatal errors. Same class of bugs seen in past PRs.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.7
hooks:
- id: ruff
args: [--select, "E9,F63,F7,F821"]
files: ^montage/