.pre-commit-config.yaml•1.6 kB
default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: tests
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-toml
exclude: tests/fixtures/invalid_lock/uv\.lock
- id: check-yaml
- id: pretty-format-json
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
- id: check-ast
- id: debug-statements
- id: check-docstring-first
- id: detect-private-key
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.13.0
hooks:
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --respect-gitignore]
exclude: ".*uv.lock|.*_static"
# Run the formatter.
- id: ruff-format
args: [--respect-gitignore]
exclude: ".*uv.lock|.*_static"
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
hooks:
- id: mypy
args: [--config-file=mypy.ini]
# Inspired by: https://medium.com/@fistralpro/pytest-pre-commit-hook-b492edd0560e
# Running pytest with uv will slow down the commit process.
# - repo: local
# hooks:
# - id: pytest
# name: pytest using uv
# entry: bash -c "MCP_SERVER_INCLUDE_METADATA_IN_RESPONSE=true MCP_SERVER_TRANSPORT=streamable-http uv run --group test pytest tests/"
# language: system
# types: [python]
# pass_filenames: false
# always_run: true