Skip to content

feat: add --strip to delete whole-line flagged comments - #67

Merged
ryanleecode merged 2 commits into
masterfrom
feature/strip-flagged-comments
Aug 26, 2026
Merged

feat: add --strip to delete whole-line flagged comments#67
ryanleecode merged 2 commits into
masterfrom
feature/strip-flagged-comments

Conversation

@systemfsoftware-maker

Copy link
Copy Markdown
Collaborator

The hook could only warn. Agents treated that as something to argue with, or regenerated the whole file if the host blocked the write.

--strip deletes whole-line flagged comments from the file named in the payload after the write. Trailing and inline comments stay and are reported. Occupancy is the finding's own source text from tree-sitter, so every supported language is covered — not a JS/Python comment grammar. Without the flag, behaviour is unchanged, including piped payloads whose path is not on disk.

After a strip, the message on stderr tells the agent what to do next (rename, extract, or tighten a type) instead of asking it not to write comments.

Session-settled: strip is opt-in (--strip), not the default (user-directed).

cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test --all-targets — 117 passed locally.

The default still only reports. --strip deletes whole-line flagged
comments from the file named in the payload; trailing and inline
comments stay and are reported. A missing file is report-only.
Occupancy is the finding's own source text, not a JS/Python comment
grammar. Prove that with a tree-sitter matrix and keep \r\n intact.
@ryanleecode
ryanleecode merged commit b878cb8 into master Aug 26, 2026
11 checks passed
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.

2 participants