repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-toml
- id: check-json
- id: end-of-file-fixer
exclude: '\.py$'
- id: trailing-whitespace
exclude: '\.py$'
- id: mixed-line-ending
exclude: '\.py$'
- id: check-added-large-files
args: ["--maxkb=1000"]
- id: check-merge-conflict
- id: check-case-conflict
- id: detect-private-key
# Ruff - linting & formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: ruff-check
args: ["--fix"]
- id: ruff-format
# Type checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
- id: mypy
additional_dependencies:
- fastmcp>=2.0.0
- httpx>=0.28.0
- pydantic>=2.0.0
- types-pyyaml
- pytest>=8.0.0
- openai>=1.0.0
- tenacity>=8.0.0
args: ["--strict", "--allow-untyped-calls", "--ignore-missing-imports"]
exclude: "^tests/"
# Security linting
- repo: https://github.com/PyCQA/bandit
rev: 1.9.2
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
# Dead code detection
- repo: https://github.com/asottile/dead
rev: v2.1.0
hooks:
- id: dead
args: ["--exclude", "tests/|src/relace_mcp/tools/__init__\\.py"]
# Docstring coverage (for MCP tool definitions)
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
- id: interrogate
args:
[
"--fail-under=0",
"--ignore-init-method",
"--ignore-init-module",
"--ignore-private",
"--ignore-nested-functions",
"--exclude",
"tests",
"-v",
]
files: ^src/relace_mcp/(tools|server)\.py$