sqc 0.4.13

Software Code Quality - CERT C compliance checker
# Pre-commit hooks for tools_scq
# Install: pre-commit install
# Run manually: pre-commit run --all-files
#
# Prerequisites:
#   cargo install cargo-llvm-cov
#
# Coverage output:
#   The cargo-llvm-cov hook produces lcov.info in the project root.
#   CI pipelines can publish this artifact directly — no separate coverage step needed.

repos:
  # Local hooks for Rust

  - 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