Skip to content

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

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

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
@KuSh

KuSh commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Closing in favour of #2397, which makes the identical one line change for issue #2385, from contains to starts_with in the block comment opener, and carries wider regression coverage and a green CI run. Merging it makes this change redundant. Review and comments are very welcome on #2397, or reply here if your version covers a case it misses.

@KuSh KuSh closed this Sep 19, 2026
@KuSh KuSh added the duplicate This issue or pull request already exists label Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists

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)

3 participants