Skip to content

fix(core): exclude hidden glob matches before limiting results - #47422

Merged
kitlangton merged 2 commits into
v2from
glob-hidden-files
Sep 9, 2026
Merged

fix(core): exclude hidden glob matches before limiting results#47422
kitlangton merged 2 commits into
v2from
glob-hidden-files

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #47421

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Why: **/*.ts returns hidden basenames even when hidden is omitted or false. Positive ripgrep globs override its default hidden-file filtering, and hidden matches can consume the result limit.

What changes: Apply a native hidden-path exclusion after the positive glob, before collecting limited results. hidden: true still includes hidden files and directories; .git remains excluded.

Scope: The glob API's flag applies to broad and explicit hidden-name patterns. find and grep keep their separate existing behavior.

How did you verify your code works?

From packages/core:

bun run test test/ripgrep.test.ts test/tool-search.test.ts
bun typecheck

Fresh regressions reproduce hidden matches and incorrect truncation on the base. All ten new adapter/tool cases now pass using native ripgrep. The complete focused suites pass 27 tests, including existing find, ignore-file and Git-metadata controls. No new glob ignore-file compliance is claimed.

Additional combined-tree checks passed full Core twice (5,267 passed, 41 skipped). An earlier run hit pty > retains exited sessions until removed; the timeout did not recur in paired clean-base/fixed reruns, but its cause remains unresolved.

Screenshots / recordings

Not a UI change; tests check actual native search results and tool output.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@kitlangton
kitlangton marked this pull request as ready for review September 9, 2026 13:18
@kitlangton
kitlangton merged commit 4ea368e into v2 Sep 9, 2026
12 of 13 checks passed
@kitlangton
kitlangton deleted the glob-hidden-files branch September 9, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant