Skip to content

fix: preserve comments in minimal read filter#971

Closed
Daishuyuan wants to merge 1 commit intortk-ai:masterfrom
Daishuyuan:codex/preserve-comments-in-minimal-read
Closed

fix: preserve comments in minimal read filter#971
Daishuyuan wants to merge 1 commit intortk-ai:masterfrom
Daishuyuan:codex/preserve-comments-in-minimal-read

Conversation

@Daishuyuan
Copy link
Copy Markdown

Summary

This change keeps comments visible when rtk read --level minimal is used.

  • make MinimalFilter only normalize trailing whitespace and repeated blank lines
  • move comment stripping into a dedicated helper used by AggressiveFilter
  • add regression tests for both minimal and aggressive behavior

Why

minimal was still dropping source comments, which made rtk read less useful when the reader needed inline notes, rationale, or TODO context from the file.

Verification

  • cargo +stable test test_minimal_filter_preserves_comments -- --nocapture
  • cargo +stable test test_aggressive_filter_still_removes_comments -- --nocapture
  • cargo +stable test test_json_no_comment_stripping -- --nocapture

@Daishuyuan Daishuyuan closed this Apr 2, 2026
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