diff options
Diffstat (limited to 'src/Stream.zig')
| -rw-r--r-- | src/Stream.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Stream.zig b/src/Stream.zig index 2641fc73..11fa7a31 100644 --- a/src/Stream.zig +++ b/src/Stream.zig @@ -46,6 +46,11 @@ const batch_bytes = 256 * 1024; const max_file_bytes = 16 << 20; /// The walk goes no deeper than this many directories below its root. const max_walk_depth = 16; +/// Directories the walk never enters. +const find_skip = [_][]const u8{ + ".git", ".jj", "target", "node_modules", + ".venv", "__pycache__", ".zig-cache", "zig-out", +}; /// What a worker sends: rows as fs.zig wrote them (`path:line:col-end /// text`, a listing's `path`), relative to the search's directory. Owned by @@ -886,7 +891,7 @@ const Worker = struct { switch (e.kind) { .directory => { if (depth + 1 >= max_walk_depth or e.name[0] == '.') continue; - if (for (filesystem.find_skip) |skip| { + if (for (find_skip) |skip| { if (std.mem.eql(u8, e.name, skip)) break true; } else false) continue; var sub = dir.openDir(w.io, e.name, .{ .iterate = true }) catch |err| switch (err) { |
