# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v3.2.0
    hooks:
      - id: trailing-whitespace
      - id: check-yaml
      - id: check-added-large-files
  - repo: local
    hooks:
      - id: prettier
        name: Prettier
        entry: npx prettier --write
        language: node
        files: \.(js|jsx|ts|tsx|json|css|scss|md|yml|yaml)$
        types: [file]
      - id: fmt
        name: fmt
        description: run cargo fmt on the workspace
        entry: cargo fmt --all -- --color always
        language: system
        pass_filenames: false
      - id: clippy
        name: clippy
        description: run cargo clippy on the workspace
        stages: [pre-push]
        entry: cargo clippy --workspace --all-features --all-targets
        language: system
        pass_filenames: false
      - id: machete
        name: machete
        description: run cargo machete on the workspace
        entry: cargo machete
        language: system
        pass_filenames: false
      - id: tests
        name: run tests
        description: run cargo test on the workspace
        stages: [pre-push]
        entry: cargo test --workspace
        language: system
        pass_filenames: false
      - id: wheel
        name: build wheel
        description: run maturin develop on the wheel
        stages: [pre-push]
        entry: sh -c "cd wheel && maturin develop"
        language: system
        pass_filenames: false
