diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-09-08 15:04:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 15:04:45 +0100 |
commit | 17276a1df9fb4926f813d2b8a5ac2a2a8bf289eb (patch) | |
tree | 7e511b1536692ab82c7ccc7f424cb572c211217e /cli/tools | |
parent | 14522fc62886b95431f62d5bd21d70cfaac780ee (diff) |
fix: empty include in config file excludes all (#20404)
Diffstat (limited to 'cli/tools')
-rw-r--r-- | cli/tools/bench/mod.rs | 4 | ||||
-rw-r--r-- | cli/tools/coverage/mod.rs | 6 | ||||
-rw-r--r-- | cli/tools/fmt.rs | 2 | ||||
-rw-r--r-- | cli/tools/lint.rs | 2 | ||||
-rw-r--r-- | cli/tools/test/mod.rs | 4 |
5 files changed, 13 insertions, 5 deletions
diff --git a/cli/tools/bench/mod.rs b/cli/tools/bench/mod.rs index d876c2504..732d889eb 100644 --- a/cli/tools/bench/mod.rs +++ b/cli/tools/bench/mod.rs @@ -429,7 +429,9 @@ pub async fn run_benchmarks_with_watch( let bench_options = cli_options.resolve_bench_options(bench_flags)?; let _ = sender.send(cli_options.watch_paths()); - let _ = sender.send(bench_options.files.include.clone()); + if let Some(include) = &bench_options.files.include { + let _ = sender.send(include.clone()); + } let graph_kind = cli_options.type_check_mode().as_graph_kind(); let module_graph_builder = factory.module_graph_builder().await?; diff --git a/cli/tools/coverage/mod.rs b/cli/tools/coverage/mod.rs index c77f869b2..6dca349f7 100644 --- a/cli/tools/coverage/mod.rs +++ b/cli/tools/coverage/mod.rs @@ -573,7 +573,11 @@ fn collect_coverages( .ignore_node_modules() .ignore_vendor_folder() .add_ignore_paths(&files.ignore) - .collect_files(&files.include)?; + .collect_files(if files.include.is_empty() { + None + } else { + Some(&files.include) + })?; for file_path in file_paths { let json = fs::read_to_string(file_path.as_path())?; diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 5ab82795c..284f20dda 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -153,7 +153,7 @@ fn collect_fmt_files(files: &FilesConfig) -> Result<Vec<PathBuf>, AnyError> { .ignore_node_modules() .ignore_vendor_folder() .add_ignore_paths(&files.exclude) - .collect_files(&files.include) + .collect_files(files.include.as_deref()) } /// Formats markdown (using <https://github.com/dprint/dprint-plugin-markdown>) and its code blocks diff --git a/cli/tools/lint.rs b/cli/tools/lint.rs index 753a9c08b..835b91f60 100644 --- a/cli/tools/lint.rs +++ b/cli/tools/lint.rs @@ -200,7 +200,7 @@ fn collect_lint_files(files: &FilesConfig) -> Result<Vec<PathBuf>, AnyError> { .ignore_node_modules() .ignore_vendor_folder() .add_ignore_paths(&files.exclude) - .collect_files(&files.include) + .collect_files(files.include.as_deref()) } pub fn print_rules_list(json: bool, maybe_rules_tags: Option<Vec<String>>) { diff --git a/cli/tools/test/mod.rs b/cli/tools/test/mod.rs index 15f8d2597..87ca7f3f5 100644 --- a/cli/tools/test/mod.rs +++ b/cli/tools/test/mod.rs @@ -1199,7 +1199,9 @@ pub async fn run_tests_with_watch( let test_options = cli_options.resolve_test_options(test_flags)?; let _ = sender.send(cli_options.watch_paths()); - let _ = sender.send(test_options.files.include.clone()); + if let Some(include) = &test_options.files.include { + let _ = sender.send(include.clone()); + } let graph_kind = cli_options.type_check_mode().as_graph_kind(); let log_level = cli_options.log_level(); |