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
      - id: check-added-large-files
        args: ["--maxkb=1000"]
      - id: check-merge-conflict
      - id: check-toml
      - id: debug-statements

  - repo: local
    hooks:
      - id: format
        name: Format code (ruff)
        entry: make format-fix
        language: system
        pass_filenames: false
        types: [python]

      - id: lint
        name: Lint code (ruff)
        entry: make lint-fix
        language: system
        pass_filenames: false
        types: [python]

      - id: type-check
        name: Type check (mypy)
        entry: make type-check
        language: system
        pass_filenames: false
        types: [python]

      - id: test
        name: Run tests (pytest)
        entry: make test-cov
        language: system
        pass_filenames: false
        always_run: true
        exclude: ^.*\.md$

      - id: docs-build
        name: Build docs (mkdocs strict)
        entry: make docs
        language: system
        pass_filenames: false
        files: ^(docs/|mkdocs\.yml|src/)
