Repository navigation
Unbalanced braces and brackets in a glob are literal - #1342
Merged
Merged
Conversation
thekevinbot
marked this pull request as ready for review
October 6, 2026 01:03
thekevinscott
enabled auto-merge
October 6, 2026 11:42
…d-brackets # Conflicts: # packages/rust/src/lib.rs
…compiler Config [[table]] globs now compile through brace::expand like path-tables, so escape_braces covers both surfaces and the separate escape_unbalanced pass is gone.
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.
Fixes #1268
An unmatched
{,}or[in a glob is a literal character, as in bash, on both path-table queries and config[[table]] glob. Path-tables:brace::escape_bracesnow escapes an unclosed[instead of leaving it for globset to reject. Config globs: newunbalanced::escape_unbalanced, applied inTableMatcher::new.Checked against
bash -O globstar -O nullglob -c 'shopt -u dotglob; printf "%s\n" ...'on a fixture holding each named file. All agree:./{a.md,./a}.md,./{a,b.md,./[a.md,./a].md,./[]a.md,./a[b.md,./[!a.md,./{a[.md,./x{.md(each returns the literal file);./a[b]c.mdand./[{].md(a real class, no match). Existing tests that used[as an invalid glob now use[z-a].Changelog / Migrations
packages/{python,ts,rust}/changelog.d/packages/{python,ts,rust}/migrations.d/E2E Verification
packages/ts/e2e-attestations/claude-1268-unbalanced-brackets.jsonpackages/python/e2e-attestations/claude-1268-unbalanced-brackets.json. Impacted files only (glob parsing/matching):glob_speed_depth_bound_test.py,glob_speed_recursive_test.py,query_contract_test.py,fanout_test.py,capture_collision_test.py-- 15 passedcargo test --features cli --no-fail-fastpasses apart from inotify watcher tests that flake under host load and pass alone; newtests/unbalanced_glob_e2e.rspasses.just e2e-attest-ts,testing-conventions e2e attest 'uv run python -m pytest tests/e2e/<impacted files> -x -q',cargo test --features cli