fail_fast: true
repos:
- repo: local
  hooks:
  - id: ruff-format
    name: ruff-format
    entry: uv run --no-sync ruff format
    language: system
    types_or: [python, markdown]
    require_serial: true
  - id: ruff-check
    name: ruff-check
    entry: uv run --no-sync ruff check
    language: system
    args: [--fix, --exit-non-zero-on-fix]
    types_or: [python, pyi]
    require_serial: true
- repo: local
  hooks:
  - id: codespell
    name: codespell
    entry: uv run --no-sync codespell
    language: system
    types: [text]
    require_serial: true
- repo: local
  hooks:
  - id: update-pyi-files
    name: update-pyi-files
    description: Update pyi files as needed
    entry: uv run --no-sync python scripts/make_pyi.py
    language: system
    always_run: true
    require_serial: true
- repo: local
  hooks:
  - id: pyright
    name: pyright
    entry: uv run --no-sync pyright
    language: system
    types: [python]
    require_serial: true
- repo: local
  hooks:
  # The second opinion the assert_type examples exist for. Always runs: what
  # these examples catch is a source change altering an inferred type, so
  # scoping the hook to the examples themselves would never fire on the edit
  # that broke them.
  - id: ty
    name: ty
    entry: uv run --no-sync ty check --python-version 3.14 tests/type_checking
    language: system
    always_run: true
    pass_filenames: false
    require_serial: true
- repo: https://github.com/biomejs/pre-commit
  rev: 19865851e014cbe6138e295365f95ca51bf953f8 # v0.6.1
  hooks:
  - id: biome-format
    additional_dependencies: ['@biomejs/biome@2.4.8']
    args: [--indent-width, '2', --indent-style, space]
    exclude: (\.css$|docs/app/)
    require_serial: true
