Skip to content

fix(filter): preserve inline comment markers in code#2546

Open
andiahmads wants to merge 1 commit into
rtk-ai:developfrom
andiahmads:fix/minimal-filter-comment-markers
Open

fix(filter): preserve inline comment markers in code#2546
andiahmads wants to merge 1 commit into
rtk-ai:developfrom
andiahmads:fix/minimal-filter-comment-markers

Conversation

@andiahmads

Copy link
Copy Markdown

Summary

rtk read --level minimal no longer drops valid source lines just because they contain comment-looking markers inside strings or inline expressions. Before this fix, a Rust line like let glob = "packages/*"; could enter block-comment mode and hide that line plus following code until a later */ appeared.

The filter now treats block comments as removable only when the trimmed line starts with the block-comment opener, preserving inline markers while still removing full-line single-line and multi-line block comments.

Closes #2385.

Testing

  • rtk cargo test core::filter
  • rtk cargo fmt --all --check
  • rtk cargo test
  • rtk cargo clippy --all-targets

Post-Deploy Monitoring & Validation

No additional operational monitoring required. This is a local CLI filtering fix with regression coverage and no service, deployment, or runtime infrastructure surface.


Compound Engineering
Codex

@CLAassistant

CLAassistant commented Jun 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@andiahmads andiahmads marked this pull request as ready for review June 23, 2026 08:45
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.

MinimalFilter silently drops valid code lines containing // or /* anywhere in the line (contains vs starts_with)

2 participants