From 2dfc0aca7c6a04d54fe6f9a73be70fc4c591d552 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 7 Mar 2024 20:16:32 -0500 Subject: fix(publish): make include and exclude work (#22720) 1. Stops `deno publish` using some custom include/exclude behaviour from other sub commands 2. Takes ancestor directories into account when resolving gitignore 3. Backards compatible change that adds ability to unexclude an exclude by using a negated glob at a more specific level for all sub commands (see https://github.com/denoland/deno_config/pull/44). --- cli/tools/coverage/mod.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'cli/tools/coverage/mod.rs') diff --git a/cli/tools/coverage/mod.rs b/cli/tools/coverage/mod.rs index 5cc705741..66c0923de 100644 --- a/cli/tools/coverage/mod.rs +++ b/cli/tools/coverage/mod.rs @@ -388,23 +388,20 @@ fn collect_coverages( initial_cwd.to_path_buf(), )]) } else { - PathOrPatternSet::from_relative_path_or_patterns( + PathOrPatternSet::from_include_relative_path_or_patterns( initial_cwd, &files.include, )? } }), - exclude: PathOrPatternSet::from_relative_path_or_patterns( + exclude: PathOrPatternSet::from_exclude_relative_path_or_patterns( initial_cwd, &files.ignore, ) .context("Invalid ignore pattern.")?, }; - let file_paths = FileCollector::new(|file_path, _| { - file_path - .extension() - .map(|ext| ext == "json") - .unwrap_or(false) + let file_paths = FileCollector::new(|e| { + e.path.extension().map(|ext| ext == "json").unwrap_or(false) }) .ignore_git_folder() .ignore_node_modules() -- cgit v1.2.3