app_lib/
scanner_skip_dirs.rs

1//! Directory names skipped during recursive filesystem scans.
2//!
3//! Audio, DAW, preset, PDF, and unified walkers match on the **final path
4//! component** (case-sensitive on POSIX). Traversal sites also skip any name
5//! starting with `.` (hidden) or `@` (Synology NAS). This list names additional
6//! non-hidden directories that are almost never user media (dependency trees,
7//! build caches, OS metadata).
8
9pub const SCANNER_SKIP_DIRS: &[&str] = &[
10    "node_modules",
11    "bower_components",
12    ".git",
13    ".Trash",
14    "$RECYCLE.BIN",
15    "#recycle",
16    "System Volume Information",
17    "lost+found",
18    ".cache",
19    "__pycache__",
20    "__pypackages__",
21    // Never contain user audio/preset/pdf/daw content.
22    "Caches",            // ~/Library/Caches, /Library/Caches, app caches
23    "DerivedData",       // Xcode build artifacts
24    "Backups.backupdb",  // Time Machine bundle
25    "__MACOSX",          // zip-extract artifact
26    "target",            // Rust/Cargo (and some other tools) build output
27    "Pods",              // CocoaPods
28    "Carthage",          // Carthage / iOS dependency checkouts + builds
29    "vendor",            // Composer, Bundler, etc.
30    "jspm_packages",     // legacy JSPM (like node_modules)
31    "elm-stuff",         // Elm build cache
32    "zig-cache",         // Zig compiler cache
33    "zig-out",           // Zig default output dir
34    "cmake-build-debug", // CMake / CLion / VS default build trees
35    "cmake-build-release",
36    "cmake-build-relwithdebinfo",
37    "cmake-build-minsizerel",
38    "buck-out",  // Buck build output
39    "bazel-bin", // Bazel convenience symlinks / trees under workspace
40    "bazel-out",
41    "bazel-testlogs",
42    "_build",           // Mix / Rebar / Erlang build (Elixir deps tree)
43    "nimcache",         // Nim compiler cache
44    "nimbledeps",       // Nimble package dir
45    "htmlcov",          // Python coverage HTML reports (often huge)
46    "coverage",         // JS/Rust/etc. test coverage output (common folder name)
47    "lcov-report",      // LCOV HTML report dir
48    "storybook-static", // Storybook static export
49    // MSVC / Visual Studio / generic out-of-tree build dirs (not only `cmake-build-*`).
50    "Debug",
51    "Release",
52    "RelWithDebInfo",
53    "MinSizeRel",
54    "x64",
55    "x86",
56    // JS / Gradle / Flutter / generic packaged output.
57    "dist",
58    "out",
59    "build",
60    // .NET intermediate, NuGet package cache.
61    "obj",
62    "packages",
63    // Python virtualenvs and wheel trees (non-hidden names).
64    "venv",
65    "site-packages",
66    // Synology NAS (`#recycle` already listed). `@`-prefixed dirs use traversal guard.
67    "#snapshot",
68];
69
70#[cfg(test)]
71mod tests {
72    use super::SCANNER_SKIP_DIRS;
73
74    #[test]
75    fn skip_dirs_contains_core_junk_and_build_artifacts() {
76        for d in [
77            "node_modules",
78            "bower_components",
79            ".git",
80            "Caches",
81            "DerivedData",
82            "target",
83            "Pods",
84            "vendor",
85            "lost+found",
86            "__pypackages__",
87            "Carthage",
88            "zig-cache",
89            "htmlcov",
90            "bazel-out",
91            "_build",
92            "Debug",
93            "Release",
94            "dist",
95            "build",
96            "venv",
97            "#snapshot",
98        ] {
99            assert!(
100                SCANNER_SKIP_DIRS.contains(&d),
101                "SCANNER_SKIP_DIRS should contain {:?}",
102                d
103            );
104        }
105    }
106
107    #[test]
108    fn skip_dirs_has_no_duplicates() {
109        let mut seen = std::collections::HashSet::new();
110        for &d in SCANNER_SKIP_DIRS {
111            assert!(seen.insert(d), "duplicate skip dir entry: {:?}", d);
112        }
113    }
114}