---
# pre-commit configuration for asnumpy
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files

repos:
  # Python: ruff (linter)
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.11.0
    hooks:
      - id: ruff
        args: [--fix, --exit-non-zero-on-fix]
        files: ^(src|tests)/.*\.py$

  # Python: ruff (formatter)
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.11.0
    hooks:
      - id: ruff-format
        files: ^(src|tests)/.*\.py$

  # Python: mypy (type checker)
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.15.0
    hooks:
      - id: mypy
        args: [--ignore-missing-imports, src/]
        pass_filenames: false
        files: ^src/

  # C++: clang-format
  - repo: https://github.com/pre-commit/mirrors-clang-format
    rev: v19.1.0
    hooks:
      - id: clang-format
        types_or: [c++, c]
        args: [--style=file]

  # General: trailing whitespace, file endings
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
      - id: trailing-whitespace
        exclude: \.patch$
      - id: end-of-file-fixer
        exclude: \.patch$
      - id: check-yaml
      - id: check-toml