-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
54 lines (49 loc) · 1.82 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
54 lines (49 loc) · 1.82 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
# engram - pre-commit hooks
#
# Run on every commit; CI runs the same checks. Block commits that fail.
# Install with: uv run pre-commit install
default_language_version:
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
# mypy runs through uv so the resolved dependency tree matches uv.lock and
# CI exactly. The mirrors-mypy hook installs into an isolated venv whose
# versions can diverge from uv.lock, which lets test-side errors slip past
# local pre-commit even though CI catches them. We trade hook-internal
# caching for src+tests coverage that mirrors CI.
- repo: local
hooks:
- id: mypy-uv
name: mypy (uv-managed, full repo)
entry: uv run mypy
language: system
pass_filenames: false
types: [python]
# PII discipline (self-contained - no external repo dependencies).
# Scanner + patterns live at .githooks/ inside this repo. Identity-
# specific patterns (real name, emails) load from
# ~/.config/devkit/identity.json at scan time if present; absent on
# forker machines, only structural patterns apply.
- id: pii-scan
name: PII scan
entry: bash -c 'SCANNER="$(git rev-parse --show-toplevel)/.githooks/pii-scan.sh"; if [ -x "$SCANNER" ]; then "$SCANNER" --staged; fi'
language: system
pass_filenames: false