-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
90 lines (81 loc) · 2.29 KB
/
.pre-commit-config.yaml
File metadata and controls
90 lines (81 loc) · 2.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Pre-commit hooks for PassFX
# Enforces formatting, linting, compilation safety, and attribution guards
default_language_version:
python: python3
# Skip these paths globally
exclude: |
(?x)^(
__pycache__/.*|
\.venv/.*|
venv/.*|
\.git/.*|
\.pytest_cache/.*|
\.mypy_cache/.*|
\.ruff_cache/.*|
dist/.*|
build/.*|
.*\.egg-info/.*|
\.passfx/.*
)$
repos:
# Basic hygiene hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-added-large-files
args: [--maxkb=500]
- id: check-yaml
- id: check-toml
- id: check-merge-conflict
- id: debug-statements
# Black formatting (line-length 88)
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
language_version: python3
args: [--line-length=88]
# isort for import sorting (black-compatible)
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile=black, --line-length=88]
# Local hooks for custom checks
- repo: local
hooks:
# Pylint linting - requires score 10.0
- id: pylint
name: pylint (score >= 10.0)
entry: pylint
language: system
types: [python]
args:
- --rcfile=.pylintrc
- --fail-under=10.0
files: ^passfx/.*\.py$
# Python compilation check
- id: py-compile
name: python compile check
entry: python -m py_compile
language: system
types: [python]
files: ^passfx/.*\.py$
# Attribution guard - blocks AI/Claude references in source files
- id: attribution-guard
name: attribution guard (no AI references)
entry: python scripts/attribution_guard.py
language: system
types_or: [python, markdown, text, yaml, toml]
pass_filenames: true
# Attribution guard - blocks AI/Claude references in commit messages
- id: commit-msg-guard
name: commit message guard (no AI references)
entry: python scripts/commit_msg_guard.py
language: system
stages: [commit-msg]
always_run: true
pass_filenames: true