feat(flare-code): regex pre-filter for ponytail over-engineering checks - #293
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds regex-based pre-filtering to over-engineering detection, removing header noise and skipping generated-code content while preserving relevant code. Tests cover filtering behavior and continued lodash detection. ChangesOver-engineering pre-filtering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…checks Strips copyright/SPDX headers and blanks out generated files before detect_over_engineering runs, so noise lines never reach the check and generated files are skipped entirely rather than false-positiving on their own boilerplate. Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: item-54-regex-pre-filter
ac1dfbf to
d656bb4
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/flare-code/src/sub_skills.rs`:
- Around line 88-97: Update pre_filter in
crates/flare-code/src/sub_skills.rs:88-97 to use any() over the first five lines
for generated-marker detection, and map filtered lines to empty strings instead
of removing them so original line numbers remain aligned. Update the expected
outputs at crates/flare-code/src/sub_skills.rs:246-250 and :272-276 to include
the preserved blank lines as \n\nfn foo() {}.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b2cf0f33-57ca-4392-938d-e4b2acdb042e
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
crates/flare-code/Cargo.tomlcrates/flare-code/src/sub_skills.rs
pre_filter stripped noise/copyright/generated lines entirely, shifting line numbers for every finding detect_over_engineering reports after a stripped line. Blank filtered lines instead of removing them so the line count — and every downstream finding's line number — stays aligned with the original source. Agentflare-Agent: claude-code_2-1-216_agent Agentflare-Branch: item-54-regex-pre-filter
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
✅ Action performedReview finished.
|
✅ Action performedReview finished.
|
Summary
pre_filter()incrates/flare-code/src/sub_skills.rs: strips copyright/SPDX header lines via regex beforedetect_over_engineeringruns, and returns empty entirely for files carrying a generated-code marker (@generated,DO NOT EDIT, etc.) in their first 5 lines.regex = "1"added as a new dependency toflare-code.Test plan
cargo test -p agentflare-flare-code— 48/48 pass, including 8 new tests for the pre-filter (import/require preserved, copyright/SPDX stripped, generated-file short-circuit, existing lodash-detection still fires post-filter)cargo fmt --check— cleancargo clippy -p agentflare-flare-code --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic— cleancargo test --workspace— 692 passed, 0 failedSummary by CodeRabbit