repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
        exclude: \.ambr$
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
      - id: check-merge-conflict

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.15.2
    hooks:
      - id: ruff
        args: [--fix]
      - id: ruff-format

  # Run unit tests before every commit (< 3s, no API keys, no graph compilation).
  # Integration + contract tests run in CI on every PR — see .github/workflows/ci.yml.
  - repo: local
    hooks:
      - id: unit-tests
        name: Unit tests
        language: system
        entry: uv run pytest tests/unit/ --tb=short -q
        pass_filenames: false
        files: \.py$
