repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
      - id: check-added-large-files
      - id: check-case-conflict
      - id: check-illegal-windows-names
      - id: check-json
      - id: check-merge-conflict
      - id: check-symlinks
      - id: check-vcs-permalinks
      - id: check-yaml
      - id: destroyed-symlinks
      - id: detect-private-key
      - id: end-of-file-fixer
        exclude: "[.]out$"
      - id: fix-byte-order-marker
      - id: mixed-line-ending
        exclude: "[.]out$"
        args: ["--fix=auto"]
      - id: trailing-whitespace
        exclude: "[.](?:sql|out)$"
  - repo: https://github.com/codespell-project/codespell
    rev: v2.4.1
    hooks:
      - id: codespell
  - repo: local
    hooks:
      - id: indent
        name: indent code
        language: system
        entry: ./dev/indent.sh
        pass_filenames: false
  - repo: local
    hooks:
      - id: clang-tidy
        name: clang-tidy static analysis
        language: system
        entry: sh -c 'test -f compile_commands.json && clang-tidy -p . "$@" || true' --
        files: '\.(c|cpp)$'
        exclude: "^vendor/"
  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v3.1.0
    hooks:
      - id: prettier
        name: JSON and YAML formatting
        types_or: [json, yaml]
