feat: add --strip to delete whole-line flagged comments - #67
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hook could only warn. Agents treated that as something to argue with, or regenerated the whole file if the host blocked the write.
--stripdeletes 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.