repos:
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt (auto-fix)
description: Format Rust code with rustfmt
entry: bash -c 'cargo fmt --all 2>&1 && echo "Formatting complete"'
language: system
pass_filenames: false
types: [rust]
verbose: true
- id: cargo-clippy
name: cargo clippy
description: Lint Rust code with Clippy - deny warnings (all targets including tests)
entry: bash -c 'cargo clippy --all-targets --all-features -- -D warnings 2>&1'
language: system
pass_filenames: false
types: [rust]
verbose: true
- id: cargo-llvm-cov
name: cargo llvm-cov (tests + 75% coverage gate)
description: Run tests with coverage — fail if line coverage < 75%. Produces lcov.info.
entry: bash -c 'scripts/coverage-gate.sh 75 2>&1'
language: system
pass_filenames: false
verbose: true