repos:
  - repo: local
    hooks:
      - id: cargo-fmt
        name: cargo fmt
        entry: bash -c 'cargo fmt --all && git add -u'
        language: system
        types: [rust]
        pass_filenames: false

      - id: cargo-clippy
        name: cargo clippy (all targets, all features)
        entry: cargo clippy --all-targets --all-features --workspace
        language: system
        types: [rust]
        pass_filenames: false

      - id: cargo-check
        name: cargo check (all targets, all features)
        entry: cargo check --all-targets --all-features --workspace
        language: system
        types: [rust]
        pass_filenames: false

      - id: cargo-test
        name: cargo test
        entry: cargo test --all-targets --all-features --workspace -- --test-threads=1
        language: system
        types: [rust]
        env:
          TENEX_STATE_PATH: /tmp/tenex-pre-commit-state.json
        pass_filenames: false

      - id: cargo-coverage
        name: cargo llvm-cov (90% lines + functions)
        entry: cargo cov
        language: system
        types: [rust]
        env:
          TENEX_STATE_PATH: /tmp/tenex-pre-commit-state.json
        pass_filenames: false
