Skip to content

feat: clippy/lint output grouping by rule #430

@bug-ops

Description

@bug-ops

Parent

Epic: #426

Summary

Group clippy warnings/errors by lint rule, showing count and first occurrence instead of repeating the full diagnostic for each instance.

Expected Savings

70-90% on large codebases with many warnings.

Behavior

# Before: 25 full clippy diagnostics, each 5-10 lines

# After:
clippy::needless_return (12 occurrences)
  → crates/zeph-core/src/agent/mod.rs:45
clippy::unused_imports (8 occurrences)
  → crates/zeph-llm/src/claude.rs:3
error[E0599]: method not found (1)
  → crates/zeph-tools/src/shell.rs:112:
    | self.foo()
    | ^^^ method not found in `ShellExecutor`

warnings: 20, errors: 1

Rules

  • Errors: always show full diagnostic (agent needs details to fix)
  • Warnings: group by rule, show count + first location
  • On zero warnings/errors: just the summary line

Implementation

  • ClippyOutputFilter matching cargo clippy
  • Parse warning[rule] and error[E####] headers
  • Group warnings, preserve full error blocks
  • Emit summary counts

Acceptance Criteria

  • Warnings grouped by rule with count
  • Errors shown in full
  • Clean output → summary only
  • Unit tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    M26Milestone 26: Smart tool output filteringP1Important prioritysize/Mtoken-savingsToken economy improvementstoolsTool execution and MCP integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions