-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
66 lines (61 loc) · 2.28 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
66 lines (61 loc) · 2.28 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 ATDM (Phase 10).
#
# Install once:
# pdm run pre-commit install
# Run manually on all files:
# pdm run pre-commit run --all-files
#
# The hooks mirror what `make lint` and the architecture fitness tests check —
# catching violations at commit time so you don't push a red CI build.
repos:
# File hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=1024]
# Ruff (lint + format) — same versions as project dev deps.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.13
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
# Architecture fitness tests — runs only the tests in tests/architecture/.
# Fast enough for every commit (<100ms) and catches AR-003 / NFR-011 /
# NFR-012 violations before they hit CI.
- repo: local
hooks:
- id: architecture-fitness
name: architecture fitness tests
entry: pdm run pytest tests/architecture --no-header --quiet
language: system
pass_filenames: false
types: [python]
stages: [pre-commit]
- id: no-emoji-scan
name: no emoji in committed text
entry: pdm run pytest tests/architecture/test_no_emoji.py --no-header --quiet
language: system
pass_filenames: false
# Run on every commit regardless of language because Markdown / YAML
# changes are the most common place emojis slip in.
types_or: [python, markdown, yaml, toml, html, javascript, ts]
stages: [pre-commit]
- id: pdm-lock-fresh
name: pdm.lock content_hash matches pyproject.toml
# If a commit changes pyproject.toml but didn't refresh pdm.lock,
# CI's `pdm install` re-resolves from pyproject.toml on a Linux
# runner and silently breaks. See CHANGELOG 2026-05-21 "pdm.lock
# content_hash gets stale" for the full story. Catch it here
# instead of after the push.
entry: pdm lock --check
language: system
pass_filenames: false
files: ^(pyproject\.toml|pdm\.lock)$
stages: [pre-commit]