Repository navigation
fix: reject invalid regexes in --ignore-all-in-file - #658
Merged
bootandy merged 1 commit intoNov 25, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
-I/--ignore-all-in-filesilently drops any line that is not a valid regex, so paths the user meant to exclude still show up and dust exits 0.For example, with an ignore file containing
[secretand^other$, the first line is discarded without any message.Cause: the lines are compiled with
Regex::newand the errors are thrown away withfilter_map(|x| x.ok()).Fix: compile the lines with
get_regex_value, the helper already used for--filterand--invert-filter. The-Ihelp says its entries are added to the--invert-filterregexes, so a bad entry now prints the sameIgnoring bad value for regex ...error and exits with code 1.Note the behaviour change: an ignore file with a line such as
*.log(a glob, not a regex) used to run with that line skipped, and now fails. If you would rather warn and continue, I can change it to that.This is separate from #657, which handles an unreadable file; the two touch neighbouring lines.
Test: added
test_ignore_all_in_file_rejects_invalid_regex, which fails before the change (exit code 0) and passes after.cargo testandcargo fmt --checkpass.AI assistance (Claude Code) was used to prepare this change.
🤖 Generated with Claude Code