Skip to main content

features_cli/
skip_dirs.rs

1//! Folder names left out when walking a project.
2
3/// Folders every walker skips by default. Add a name here to skip another folder
4/// everywhere; `--include-skipped-dirs` preserves them for feature detection,
5/// stats and import scanning.
6pub const SKIPPED_DIRS: &[&str] = &["node_modules"];
7
8/// Folders the metadata comment and file map walkers also leave out, since they
9/// don't hold source files to look at.
10const NON_SOURCE_DIRS: &[&str] = &[
11    "target",
12    "dist",
13    "build",
14    ".git",
15    ".svn",
16    ".hg",
17    "vendor",
18    "__pycache__",
19    ".next",
20    ".nuxt",
21    "coverage",
22];
23
24/// Check if the metadata comment and file map walkers should leave a folder out
25pub fn is_non_source_dir(dir_name: &str) -> bool {
26    SKIPPED_DIRS.contains(&dir_name) || NON_SOURCE_DIRS.contains(&dir_name)
27}