-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
58 lines (52 loc) · 2.08 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
58 lines (52 loc) · 2.08 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
# Pre-commit hooks for MCPProxy
# Install: brew install prek && prek install && prek install --hook-type pre-push
# Run manually: prek run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
# A unified diff encodes meaning in leading whitespace: an unchanged
# context line begins with a single space, and a blank context line IS
# that lone space. Stripping it turns valid patches into ones git apply
# rejects — observed on bench/mcpmark/mcpproxy_arm.patch, where the hook
# silently rewrote 4 context lines.
exclude: '\.(patch|diff)$'
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-added-large-files
# A 43 MB `warmtiktoken` Mach-O binary was committed at the repo root
# in #1153 (go build in the wrong cwd). Screenshots and verification
# reports are legitimately 1-6 MB, so cap well above them.
args: ['--maxkb=8192']
- repo: local
hooks:
- id: no-native-binaries
name: Reject compiled executables (Mach-O/ELF/PE)
entry: scripts/check-no-native-binaries.sh
language: script
# Uses `file(1)`; images are excluded to keep the hook fast.
exclude: '^(docs|website|assets|specs)/.*\.(png|jpe?g|gif|ico|webp|svg|pdf)$'
- id: gofmt
name: gofmt
entry: gofmt -w
language: system
types: [go]
- id: swagger-verify
name: Verify OpenAPI spec is up to date
entry: make swagger-verify
language: system
stages: [pre-push]
pass_filenames: false
- id: roadmap-verify
name: Verify ROADMAP.md is up to date
entry: python3 scripts/gen-roadmap.py --check
language: system
pass_filenames: false
files: '^(roadmap\.yaml|ROADMAP\.md|scripts/gen-roadmap\.py|specs/.*/tasks\.md)$'
- id: go-build
name: go build
entry: go build -o /dev/null ./cmd/mcpproxy
language: system
stages: [pre-push]
pass_filenames: false