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]