Skip to content

Fix rimport escape check diverging from filter.quote() - #460

Merged
mbrt merged 2 commits into
masterfrom
fix-456-review
Sep 11, 2026
Merged

mbrt merged 2 commits into
masterfrom
fix-456-review

Conversation

@mbrt

@mbrt mbrt commented Sep 11, 2026

Copy link
Copy Markdown
Owner

This is taken from patcox#1, with my applied fix.

Close #456.

claude and others added 2 commits September 11, 2026 16:08
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

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.87%. Comparing base (582d8c5) to head (52d2ab0).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mbrt
mbrt merged commit 9892c75 into master Sep 11, 2026
5 checks passed
@mbrt
mbrt deleted the fix-456-review branch September 11, 2026 14:10
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.

download + apply can silently invert exclusion filters with parens (needsEscape / quote character-set mismatch)

2 participants