diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-01-13 22:56:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-13 16:56:29 -0500 |
commit | 6557642fc8aafe35b3884ca0a04da75451efabf4 (patch) | |
tree | 65938984a27c8faedfbc2e986b0092e976348f88 /cli/args/flags.rs | |
parent | 052bcc62bba6f5b25eb016a5c8ebf0716ba5a0dc (diff) |
refactor(coverage): use FileFlags struct (#17388)
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r-- | cli/args/flags.rs | 21 |
1 files changed, 13 insertions, 8 deletions
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<PathBuf>, + pub files: FileFlags, pub output: Option<PathBuf>, - pub ignore: Vec<PathBuf>, pub include: Vec<String>, pub exclude: Vec<String>, 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, |