Skip to content

feat(gcc): add gcc/g++/clang compiler output filter#770

Open
cardillo wants to merge 1 commit intortk-ai:developfrom
cardillo:feat/gcc-output-filter
Open

feat(gcc): add gcc/g++/clang compiler output filter#770
cardillo wants to merge 1 commit intortk-ai:developfrom
cardillo:feat/gcc-output-filter

Conversation

@cardillo
Copy link

Adds rtk gcc command that groups diagnostics by file, strips verbose caret/source-snippet context lines, and shows a compact BUILD FAILED summary or warnings-only view.

  • 60-80% token savings on typical compiler output
  • Handles gcc, g++, clang, clang++ (via --compiler flag)
  • Strips "In file included from", caret (^), pipe (|) context lines
  • Groups errors by file, sorted by error count descending
  • Preserves make error lines for CI/CD exit-code context
  • 13 unit tests covering all paths, including token savings assertions
  • Registered in discover/rules.rs for automatic hook rewriting

https://claude.ai/code/session_01WfWYojKvkiHdDDHQbYcAyz

Summary

  • Output filter for c/c++ compile commands from gcc and clang

Test plan

Running locally and automated test suite.

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk <command> output inspected

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

Adds `rtk gcc` command that groups diagnostics by file, strips verbose
caret/source-snippet context lines, and shows a compact BUILD FAILED
summary or warnings-only view.

- 60-80% token savings on typical compiler output
- Handles gcc, g++, clang, clang++ (via --compiler flag)
- Strips "In file included from", caret (^), pipe (|) context lines
- Groups errors by file, sorted by error count descending
- Preserves make error lines for CI/CD exit-code context
- 13 unit tests covering all paths, including token savings assertions
- Registered in discover/rules.rs for automatic hook rewriting

https://claude.ai/code/session_01WfWYojKvkiHdDDHQbYcAyz
Signed-off-by: Claude <noreply@anthropic.com>
Signed-off-by: Bryan Cardillo <bryan.cardillo@gmail.com>
@pszymkowiak pszymkowiak added effort-medium 1-2 jours, quelques fichiers enhancement New feature or request labels Mar 21, 2026
@pszymkowiak
Copy link
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

Type feature
🟢 Risk low

Summary

Adds a new rtk gcc output filter command that parses and compacts gcc/g++/clang/clang++ compiler diagnostics. It groups errors and warnings by file, strips verbose caret/source-snippet context lines, and provides a compact BUILD FAILED or warnings-only summary with 60-80% token savings. Includes 13 unit tests and registration in the discovery/rules system.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Analyzed automatically by wshm · This is an automated analysis, not a human review.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort-medium 1-2 jours, quelques fichiers enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants