# See https://pre-commit.com for more information
# prek is a faster drop-in replacement: https://github.com/j178/prek
repos:
  - repo: local
    hooks:
      - id: cargo-fmt
        name: cargo fmt
        description: Check if all files follow the rustfmt style
        entry: cargo fmt --all -- --check
        language: system
        types: [rust]
        pass_filenames: false

      - id: cargo-clippy
        name: cargo clippy
        description: Run clippy lints on Rust code (also catches compile errors)
        entry: cargo clippy --all-targets --all-features -- -D warnings
        language: system
        types: [rust]
        pass_filenames: false

      # Note: cargo-check is intentionally omitted - clippy already compiles the code

      - id: cargo-test
        name: cargo test
        description: Run the test suite
        entry: cargo test
        language: system
        types: [rust]
        pass_filenames: false
        stages: [pre-push]  # Only run on push, not commit (tests can be slow)
