.pre-commit-config.yaml•1.43 kB
# Pre-commit hooks for Claude Code Bridge
# Install: pip install pre-commit && pre-commit install
repos:
# Secret detection
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
# General file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
args: ['--maxkb=500']
- id: check-json
- id: check-merge-conflict
- id: mixed-line-ending
# Python code quality
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
# Python security
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: ['-c', 'pyproject.toml']
additional_dependencies: ['bandit[toml]']
# Additional security checks
- repo: local
hooks:
- id: check-token-files
name: Check for token files
entry: bash -c 'if git diff --cached --name-only | grep -E "\.yolo_tokens\.json|yolo_audit\.log|bridge_audit\.log"; then echo "ERROR: Token/audit files should not be committed!"; exit 1; fi'
language: system
pass_filenames: false