57 lines
1.8 KiB
YAML
57 lines
1.8 KiB
YAML
# Pre-commit hooks for sync-protocol.
|
|
#
|
|
# Install: uv run --group dev pre-commit install
|
|
# Run once: uv run --group dev pre-commit run --all-files
|
|
|
|
default_language_version:
|
|
python: python3.12
|
|
|
|
repos:
|
|
# ---------------------------------------------------------------------------
|
|
# General hygiene
|
|
# ---------------------------------------------------------------------------
|
|
- 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-toml
|
|
- id: check-json
|
|
- id: check-merge-conflict
|
|
- id: debug-statements
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Black — code formatter
|
|
# ---------------------------------------------------------------------------
|
|
- repo: https://github.com/psf/black
|
|
rev: 26.5.1
|
|
hooks:
|
|
- id: black
|
|
language_version: python3.12
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Ruff — linter + import sorter (auto-fix on commit)
|
|
# ---------------------------------------------------------------------------
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
rev: v0.16.4
|
|
hooks:
|
|
- id: ruff
|
|
args: [--fix, --exit-non-zero-on-fix]
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Mypy — static type checker
|
|
# ---------------------------------------------------------------------------
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
rev: v2.3.1
|
|
hooks:
|
|
- id: mypy
|
|
args: [--config-file, pyproject.toml]
|
|
exclude: ^src/protocol/
|
|
additional_dependencies:
|
|
- "pydantic>=2.13.4"
|
|
- "pydantic-settings>=2.15.0"
|
|
- "click>=8.4.2"
|
|
- "jinja2>=3.1.6"
|
|
- "pytest>=9.1.1"
|