fix(indexer): skip directories starting with '.' (#20)#22
Conversation
Code ReviewOverviewThis PR fixes issue #20 by preventing the client indexer from walking into hidden directories (those starting with Implementation feedbackMinor: The call site reads: .filter_entry(|e| !(e.file_type().is_dir() && is_dot_dir(e)))The fn is_dot_dir(e: &walkdir::DirEntry) -> bool {
e.file_type().is_dir()
&& e.depth() > 0
&& e.file_name().to_str().is_some_and(|s| s.starts_with('.'))
}
// call site becomes:
.filter_entry(|e| !is_dot_dir(e))Question: dotfiles inside normal subdirectories The filter only prunes directories whose names start with TestsThe four test cases cover exactly the behavioural contract described in the spec, and using a real filesystem via
Documentation files
Summary
Good fix overall — the |
Summary
.(e.g..git/,.vscode/,notes/.tmp/)..directly under the storage root remain eligible, preserving the existing.shopping-list/.shopping-checked/.bookmarkswhitelist inchunker::is_text.WalkDir::filter_entryso the indexer prunes hidden subtrees during the walk rather than walking and discarding — real IO win for big hidden dirs like.git/.Closes #20.
Scope decisions
is_dot_dirguards ondepth() > 0, so users with a hidden storage path (e.g.~/.cooklang) still get their files indexed.filter_entryand are evaluated byfilter_eligible/chunker::is_textas before.Full design and rationale:
docs/superpowers/specs/2026-05-17-skip-dot-directories-design.md.Test plan
client/src/indexer.rscover four behaviours: prune top-level dot-dir, prune nested dot-dir, keep whitelisted root dotfile, keep files when storage root itself is hidden.cargo test --workspace— all crates green..git/directory.Out of scope
.syncignore). YAGNI.