# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [pre-commit]

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
        args: [--allow-multiple-documents]
      - id: check-added-large-files

  - repo: https://github.com/psf/black-pre-commit-mirror
    rev: 24.2.0
    hooks:
      - id: black
        language_version: python3.12

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.3.0
    hooks:
      - id: ruff
        args: [--fix, --exit-non-zero-on-fix]

  - repo: https://github.com/compilerla/conventional-pre-commit
    rev: "v3.1.0"
    hooks:
      - id: conventional-pre-commit
        stages: [commit-msg]
        args:
          - --force-scope

  - repo: local
    hooks:
      - id: check-lockfile
        name: Checking uv.lock
        language: system
        entry: "uv lock --check"
        pass_filenames: false

      - id: mypy
        name: Checking types with mypy
        language: system
        entry: "uv run mypy ."
        pass_filenames: false

      - id: test
        name: Running test suite
        language: system
        entry: "uv run coverage run -m pytest"
        pass_filenames: false
        stages: [pre-push]
