Skip to content

ci(hook): tighten pre-commit clippy to --all-targets #87

@ohdearquant

Description

@ohdearquant

Context

The pre-commit hook currently runs cargo clippy --workspace -- -D warnings which lints only lib + bin targets by default. This misses lints in tests, benches, and examples — caught by CI but only after a push round-trip.

Concrete recent example: PR #79 (1a7f8c4) passed the local hook but failed CI on crates/embed/tests/simd_edge_cases.rs:591:26 (private field access in integration test after field privatization). The local hook didn't catch it because integration tests aren't part of default clippy scope.

Proposal

Tighten the hook:

-cargo clippy --workspace -- -D warnings
+cargo clippy --workspace --all-targets -- -D warnings

Blocker

--all-targets currently fails on lattice-tune lib tests with 2 pre-existing lints:

  • error: redundant_closure_for_method_calls (location TBD, need to capture)
  • One other (TBD)

These need to be fixed first or the hook becomes a wall blocking all commits.

Plan

  1. Run cargo clippy --workspace --all-targets -- -D warnings locally, capture full error list
  2. Fix all pre-existing --all-targets lints across the workspace (probably 5-20 errors total)
  3. Land the hook tightening as part of the cleanup PR

Priority

P2 — annoying but not blocking. Each missed-at-CI lint costs ~2 min push-fail-fix-push cycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions