Skip to content

Match any optional glob token under ByWholeString - #117

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/textfilter-113-bywholestring-optional-any
Sep 27, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
claude/textfilter-113-bywholestring-optional-any

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #113

What changed

DoesMatchGlob used Any to combine optional tokens only for ByWordAny. Every other mode, ByWholeString included, fell through to All. Under ByWholeString the text is a single token, so a filter of alternatives like "*.jpg *.png" could match nothing. The combinator is now All for ByWordAll and Any for everything else. That lines up with the glob hint ("text must contain one of the optional tokens") and with ByWordAny's answer on single-word text.

Tests

  • GlobByWholeStringNeedsOnlyOneOptionalTokenToMatch fails before the fix and passes after it.
  • GlobByWordAllStillNeedsEveryOptionalTokenToMatch checks that ByWordAll still needs every optional token.
  • Full suite: 108/108 passing locally on net10.0.

This PR is independent of #116 (#112). Both branch from main, and they touch different lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SZUfnvhMFzj96bfFNzbfpn


Generated by Claude Code

DoesMatchGlob combined optional tokens with All for everything except
ByWordAny, so ByWholeString required text to satisfy every alternative at
once and "*.jpg *.png" matched nothing. Only ByWordAll requires all of
them now, which is what the glob hint documents.

Fixes #113

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZUfnvhMFzj96bfFNzbfpn
…'s .gitignore rewrite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZUfnvhMFzj96bfFNzbfpn
@sonarqubecloud

Copy link
Copy Markdown

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.

Glob with ByWholeString requires every optional token to match, so "*.jpg *.png" matches nothing

2 participants