# See https://pre-commit.com for more information
repos:
  - 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-added-large-files
{% if formatting.tool == "ruff" %}
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.8.0
    hooks:
      - id: ruff
        args: [--fix]
      - id: ruff-format
{% elif formatting.tool == "black" %}
  - repo: https://github.com/psf/black
    rev: 24.10.0
    hooks:
      - id: black
        language_version: python{{ project.python_version }}
{% endif %}
{% if typing_level in ["basic", "strict"] %}
{% if formatting.type_checker == "mypy" %}
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.13.0
    hooks:
      - id: mypy
        additional_dependencies: []
{% elif formatting.type_checker == "pyright" %}
  - repo: https://github.com/RobertCraigie/pyright-python
    rev: v1.1.400
    hooks:
      - id: pyright
{% elif formatting.type_checker == "ty" %}
  - repo: https://github.com/astral-sh/ty
    rev: v0.0.1a7
    hooks:
      - id: ty
{% endif %}
{% endif %}
