Skip to content

fix(flare-code): case-insensitive + SQL-style SPDX in pre_filter noise patterns - #307

Merged
getappz merged 1 commit into
masterfrom
task/311
Jul 22, 2026
Merged

fix(flare-code): case-insensitive + SQL-style SPDX in pre_filter noise patterns#307
getappz merged 1 commit into
masterfrom
task/311

Conversation

@getappz

@getappz getappz commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Found while re-reviewing #293's merged pre_filter implementation (item #264/#311, follow-up on issue #54):

  • Copyright/SPDX header matching was case-sensitive — // copyright 2024 (lowercase) slipped through unfiltered while // Copyright 2024 was correctly stripped.
  • The SQL-style comment branch (-- ...) only recognized Copyright, not SPDX-- SPDX-License-Identifier: MIT in a .sql file wasn't stripped, unlike the // and # branches which cover both.

Both fixed in the single NOISE_PATTERNS regex: added (?i) and added SPDX to the -- alternation.

Test plan

  • cargo test -p agentflare-flare-code sub_skills:: — 18/18 pass, including 2 new tests (pre_filter_removes_sql_style_spdx_header, pre_filter_removes_lowercase_copyright_header)
  • cargo test -p agentflare-flare-code — 50/50 pass
  • cargo fmt --all — clean
  • cargo clippy -p agentflare-flare-code --all-targets --all-features -- -D warnings -A unsafe_code -A clippy::pedantic — clean

Note: issue #54's remaining acceptance criterion (user-configurable/override patterns, as opposed to these built-in defaults) is still open — not attempted here, out of scope for this small fix.

Summary by CodeRabbit

  • Bug Fixes
    • Improved noise filtering for source headers.
    • SQL-style SPDX headers and lowercase copyright headers are now correctly removed during preprocessing.
    • Expanded case-insensitive header matching for more consistent results.

…e patterns

Copyright/SPDX header matching was case-sensitive, so headers like
"// copyright 2024" slipped through unfiltered. The SQL-style comment
branch (-- ...) only recognized Copyright, not SPDX, so
"-- SPDX-License-Identifier: MIT" in SQL files wasn't stripped either,
unlike the // and # branches which cover both.

Agentflare-Agent: claude-code_2-1-217_agent
Agentflare-Branch: task/311
Agentflare-Item: 311
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e6107caa-3f4d-4c57-ad35-b9c6d14a9652

📥 Commits

Reviewing files that changed from the base of the PR and between 79d4b98 and 551d9d0.

📒 Files selected for processing (1)
  • crates/flare-code/src/sub_skills.rs

📝 Walkthrough

Walkthrough

pre_filter now removes additional case-insensitive copyright and SPDX headers, including SQL-style comments. Unit tests cover SQL SPDX headers and lowercase // copyright headers.

Changes

Noise Header Filtering

Layer / File(s) Summary
Expand noise pattern matching
crates/flare-code/src/sub_skills.rs
NOISE_PATTERNS now matches case-insensitive SQL-style Copyright and SPDX headers, with tests covering the new filtering behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • getappz/agentflare#293: Both changes modify pre_filter noise/header regex handling in crates/flare-code/src/sub_skills.rs.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: making pre_filter noise patterns case-insensitive and adding SQL-style SPDX handling.
Description check ✅ Passed The PR includes a clear Summary and Test plan; the Notes for reviewers section is missing, but the description is mostly complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/311

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit 41acba6 into master Jul 22, 2026
18 checks passed
@getappz
getappz deleted the task/311 branch July 22, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant