-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
69 lines (63 loc) · 2.6 KB
/
.pre-commit-config.yaml
File metadata and controls
69 lines (63 loc) · 2.6 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
# Pre-commit hooks configuration
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
repos:
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^(frontend/dist/|\.specify/)
- id: end-of-file-fixer
exclude: ^(frontend/dist/)
- id: check-yaml
- id: check-json
exclude: ^(package-lock\.json)
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: detect-private-key
# Local hooks
- repo: local
hooks:
# Rust linting with clippy (no Rust code, but Gourmand requires this hook)
- id: clippy
name: Clippy Rust Linting
entry: cargo clippy -- -D warnings
language: system
files: \.rs$
stages: [pre-commit, pre-merge-commit]
# Note: This project has no Rust code, but Gourmand requires clippy config
# Python linting with ruff (for scripts/get_google_token.py)
- id: ruff-check
name: Ruff Python Linting
entry: ruff check --fix
language: system
files: \.py$
stages: [pre-commit, pre-merge-commit]
# Note: Install ruff with: pip install ruff
# JavaScript/React linting with ESLint
- id: eslint
name: ESLint JavaScript Linting
entry: bash -c 'cd frontend && npm run lint:fix && cd ../backend && npm run lint:fix'
language: system
files: \.(js|jsx)$
pass_filenames: false
stages: [pre-commit, pre-merge-commit]
# Note: Install dependencies with: npm install
# Gourmand AI slop detection
- id: gourmand
name: Gourmand AI Slop Detection
entry: gourmand
language: system
pass_filenames: false
stages: [pre-commit, pre-merge-commit]
# Note: Install gourmand with: cargo install gourmand
# This hook will fail gracefully if gourmand is not installed
# Ensure package.json versions are consistent
- id: check-versions
name: Check Version Consistency
entry: "bash -c 'frontend_ver=$(grep -o '\\\"version\\\": \\\"[^\\\"]*\\\"' frontend/package.json | head -1 | cut -d\\\" -f4) && container_ver=$(grep -o '\\''version=\\\"[^\\\"]*\\\"'\\'' Containerfile | cut -d\\\" -f2) && if [ \"$frontend_ver\" != \"$container_ver\" ]; then echo \"Version mismatch: frontend=$frontend_ver, Containerfile=$container_ver\"; exit 1; fi'"
language: system
files: ^(frontend/package\.json|Containerfile)$
pass_filenames: false