From 6557642fc8aafe35b3884ca0a04da75451efabf4 Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Fri, 13 Jan 2023 22:56:29 +0100 Subject: refactor(coverage): use FileFlags struct (#17388) --- cli/args/flags.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'cli/args') diff --git a/cli/args/flags.rs b/cli/args/flags.rs index c3e2b8cfb..2e99aab82 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -87,9 +87,8 @@ pub struct CompletionsFlags { #[derive(Clone, Debug, Eq, PartialEq)] pub struct CoverageFlags { - pub files: Vec, + pub files: FileFlags, pub output: Option, - pub ignore: Vec, pub include: Vec, pub exclude: Vec, pub lcov: bool, @@ -2430,9 +2429,11 @@ fn coverage_parse(flags: &mut Flags, matches: &clap::ArgMatches) { let lcov = matches.is_present("lcov"); let output = matches.value_of("output").map(PathBuf::from); flags.subcommand = DenoSubcommand::Coverage(CoverageFlags { - files, + files: FileFlags { + include: files, + ignore, + }, output, - ignore, include, exclude, lcov, @@ -6100,9 +6101,11 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Coverage(CoverageFlags { - files: vec![PathBuf::from("foo.json")], + files: FileFlags { + include: vec![PathBuf::from("foo.json")], + ignore: vec![], + }, output: None, - ignore: vec![], include: vec![r"^file:".to_string()], exclude: vec![r"test\.(js|mjs|ts|jsx|tsx)$".to_string()], lcov: false, @@ -6125,8 +6128,10 @@ mod tests { r.unwrap(), Flags { subcommand: DenoSubcommand::Coverage(CoverageFlags { - files: vec![PathBuf::from("foo.json")], - ignore: vec![], + files: FileFlags { + include: vec![PathBuf::from("foo.json")], + ignore: vec![], + }, include: vec![r"^file:".to_string()], exclude: vec![r"test\.(js|mjs|ts|jsx|tsx)$".to_string()], lcov: true, -- cgit v1.2.3