-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
78 lines (70 loc) · 2.18 KB
/
.pre-commit-config.yaml
File metadata and controls
78 lines (70 loc) · 2.18 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
repos:
# Block TODO/STUB/FAKE patterns
- repo: local
hooks:
- id: block-todos
name: Block TODO/STUB/FAKE code
entry: bash -c 'grep -r "TODO\|STUB\|FAKE\|UNFINISHED\|NotImplementedError" --include="*.py" --exclude-dir=test . && exit 1 || exit 0'
language: system
pass_filenames: false
always_run: true
fail_fast: true
- id: no-debug-prints
name: Block debug prints
entry: bash -c 'grep -r "print(.*#.*DEBUG\|console\.log\|debugger" --include="*.py" . && exit 1 || exit 0'
language: system
pass_filenames: false
- id: no-empty-functions
name: Block empty functions
entry: python scripts/check_empty_functions.py
language: python
pass_filenames: false
additional_dependencies: [ast]
# Python code quality
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
args: [--ignore-missing-imports, --strict]
additional_dependencies: [types-all]
# Security scanning
- repo: https://github.com/PyCQA/bandit
rev: '1.8.0'
hooks:
- id: bandit
args: [-r, --skip, B101]
# Standard pre-commit hooks
- 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-added-large-files
args: ['--maxkb=500']
- id: check-merge-conflict
- id: check-ast
- id: debug-statements
- id: detect-private-key
# Prevent direct commits to main
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: no-commit-to-branch
args: [--branch, main, --branch, master]
# Run tests before commit
- repo: local
hooks:
- id: pytest-check
name: Run pytest
entry: bash -c 'cd pkg/hanzo-mcp && python -m pytest tests/test_no_stubs.py -x'
language: system
pass_filenames: false
stages: [commit]