Skip to content

fix(find): include hidden files when pattern targets dotfiles (-name ".claude.json") - #1199

Merged
FlorianBruniaux merged 1 commit into
rtk-ai:developfrom
ousamabenyounes:fix/issue-1101
Apr 13, 2026
Merged

FlorianBruniaux merged 1 commit into
rtk-ai:developfrom
ousamabenyounes:fix/issue-1101

Conversation

@ousamabenyounes

@ousamabenyounes ousamabenyounes commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • rtk find . -name ".claude.json" always returned 0 for '.claude.json' even when the files existed, because WalkBuilder::hidden(true) skips ALL hidden files and directories
  • Fix: when the -name pattern starts with ., set hidden(false) so the walker visits hidden entries; non-dotfile patterns keep the default hidden(true) behaviour
  • One-line production change + 2 regression tests

Test plan

  • cargo fmt --all passes
  • cargo clippy --all-targets — no new errors
  • cargo test --all — all tests pass
  • New tests: find_dotfile_pattern_includes_hidden, find_regular_pattern_skips_hidden
  • Manual: rtk find . -name ".gitignore" --maxdepth 1 now returns the .gitignore file

Closes #1101

🤖 Generated with Ora Studio

rtk find used WalkBuilder with .hidden(true), which skips ALL hidden
files and directories. As a result, `rtk find . -name ".claude.json"`
always returned "0 for '.claude.json'" even when the files existed.

Fix: detect when the -name pattern starts with a dot and set
.hidden(false) for that walk, so hidden entries are visited.
Non-dotfile patterns keep the default .hidden(true) behaviour.

Add regression tests covering both cases.

Closes #1101

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

@FlorianBruniaux FlorianBruniaux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean fix, tests pass.

@FlorianBruniaux
FlorianBruniaux merged commit e3a86a4 into rtk-ai:develop Apr 13, 2026
10 checks passed
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
thehoff pushed a commit to thehoff/contextcrawler that referenced this pull request May 14, 2026
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.

2 participants