# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types:
  - pre-commit
  - commit-msg

default_language_version:
  python: python3

default_stages: [pre-commit]

repos:
  - repo: https://github.com/compilerla/conventional-pre-commit
    rev: v4.2.0
    hooks:
      - id: conventional-pre-commit
        stages: [commit-msg]
        args: ["--verbose"]

  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
        args: ["--unsafe"]
      - id: check-added-large-files

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: 'v0.12.11'
    hooks:
      - id: ruff
        args: ["--fix", "--show-fixes"]
      - id: ruff-format

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.17.1
    hooks:
      - id: mypy
        additional_dependencies:
          - pydantic
          - sqlalchemy
          - types-PyYAML
          - types-cachetools
          - types-requests
          - types-aiobotocore[essential]
          - boto3-stubs[essential]
        exclude: ^(diracx-client/src/diracx/client/_generated|diracx-[a-z]+/tests/|diracx-testing/|build|extensions/gubbins/gubbins-client/src/gubbins/client/_generated)

  - repo: https://github.com/executablebooks/mdformat
    rev: 0.7.22
    hooks:
    - id: mdformat
      args: ["--number"]
      additional_dependencies:
      - mdformat-mkdocs
      - mdformat-gfm
      - mdformat-black

  - repo: https://github.com/codespell-project/codespell
    rev: v2.4.1
    hooks:
    - id: codespell
      args: ["-w"]

  - repo: local
    hooks:
      - id: check-lollygag
        name: check for lollygag
        types: [python]
        entry: '(?i)lollygag'
        language: pygrep
        files: ^diracx
