feat(searchset): ignore line comments in regexset files#3622
Merged
jqnatividad merged 3 commits intomasterfrom Mar 17, 2026
Merged
feat(searchset): ignore line comments in regexset files#3622jqnatividad merged 3 commits intomasterfrom
jqnatividad merged 3 commits intomasterfrom
Conversation
Lines starting with # in the regexset file are now treated as comments and skipped, making regex files easier to document and maintain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Trim leading whitespace before checking for '#' comment prefix so that indented comments (e.g. " # comment") are also skipped - Document the comment syntax in the command's usage text - Add searchset_comment_lines test verifying comment lines are ignored Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for # line comments in searchset regexset files so users can annotate regex lists (and keep example files readable) without affecting matching.
Changes:
- Update
searchsetregexset reader to ignore lines whose first non-whitespace character is#. - Add an integration test covering full-line and indented comment lines in regexset files.
- Update
searchsethelp text (RustUSAGEand rendered docs) to document the new comment behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/cmd/searchset.rs |
Filters out comment lines when loading regexset patterns; updates CLI help text accordingly. |
tests/test_searchset.rs |
Adds coverage for comment and indented-comment lines in regexset files. |
docs/help/searchset.md |
Documents comment-line support in regexset files. |
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.
No description provided.