Fix rimport escape check diverging from filter.quote() - #460
Merged
Merged
Conversation
rimport.needsEscape() only checked for spaces and quote characters, while filter.quote() also treats tabs, braces, parens and a bare plus sign as needing quoting. Downloaded filters using raw exclusion syntax with parentheses (e.g. "-(term)") were therefore imported as "not escaped" and silently re-quoted on export, turning the exclusion into a near-useless literal string match. Extract the character-set predicate out of filter.quote() into an exported filter.NeedsQuoting(), and have rimport.needsEscape() use it as the single source of truth, so the two can no longer diverge. Fixes #456 Co-authored-by: Pat Cox <3720677+patcox@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #460 +/- ##
==========================================
+ Coverage 37.56% 38.87% +1.31%
==========================================
Files 54 54
Lines 3674 3678 +4
==========================================
+ Hits 1380 1430 +50
+ Misses 2203 2145 -58
- Partials 91 103 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mbrt
force-pushed
the
fix-456-review
branch
from
September 11, 2026 14:09
22a04e1 to
52d2ab0
Compare
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.
This is taken from patcox#1, with my applied fix.
Close #456.