feat(cli,format): --suggest-ignores flag (#84) - #218
Conversation
Add `plumb lint --suggest-ignores` so a noisy first run on an existing codebase produces a ready-made `.plumbignore` starter. Default off. Pretty format appends a footer block listing one entry per `(rule_id, selector)` tuple, sorted by `(rule_id, selector)` so two runs produce byte-identical output. JSON format adds a `suggested_ignores` array to the existing envelope; the `run_id` hashes only the violations payload so toggling the flag does not shift it. SARIF intentionally ignores the flag — Code Scanning consumers parse the strict 2.1.0 schema. Closes #84
|
I have enough context for a complete review. Here's the full analysis: PR Review:
|
…st-ignores # Conflicts: # crates/plumb-cli/tests/cli_integration.rs
…st-ignores # Conflicts: # crates/plumb-cli/src/commands/lint.rs # crates/plumb-cli/src/main.rs
…s 1:1) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…st-ignores # Conflicts: # crates/plumb-cli/src/commands/watch.rs # crates/plumb-cli/src/main.rs
Summary
plumb lint --suggest-ignores, a default-off flag that appends a suggested.plumbignoreblock to the rendered output.(rule_id, selector)tuple. JSON format adds asuggested_ignoresarray to the envelope. SARIF intentionally ignores the flag.(rule_id, selector)and the JSONrun_idis unchanged, so determinism holds whether the flag is on or off.Closes #84.
Test plan
cargo test --workspace --all-features(4 new CLI integration tests + 7 new plumb-format unit tests, all green)cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningsjust determinism-check(3 runs oflint --format jsonbyte-identical)lint --format json --suggest-ignores3-run byte-diff also identicalcargo deny checkmdbook build+cargo doc --workspace --no-depsjust validate🤖 Generated with Claude Code