# Pre-commit hooks for QA-MCP
# See https://pre-commit.com for more information
repos:
# Ruff - Fast Python linter and formatter (replaces flake8, black, isort, etc.)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.0
hooks:
# Linter
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Formatter
- id: ruff-format
# MyPy - Static type checker
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
args: [--ignore-missing-imports, --check-untyped-defs]
additional_dependencies:
- pydantic>=2.0.0
- httpx>=0.27.0
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Remove trailing whitespace
- id: trailing-whitespace
# Ensure files end with newline
- id: end-of-file-fixer
# Check YAML files are valid
- id: check-yaml
# Check TOML files are valid
- id: check-toml
# Check JSON files are valid
- id: check-json
# Prevent large files from being committed
- id: check-added-large-files
args: [--maxkb=1000]
# Check for merge conflicts
- id: check-merge-conflict
# Check for debugger imports
- id: debug-statements
# Mixed line endings
- id: mixed-line-ending
args: [--fix=lf]
# Security - Bandit
- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
hooks:
- id: bandit
args: [-ll, -r, src/]
exclude: tests/
# CI configuration
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit hooks
autoupdate_commit_msg: |
[pre-commit.ci] pre-commit autoupdate