Skip to content

Commit 46f51c9

Browse files
authored
feat: allow including libraries into coverage report (#7663)
1 parent 94e940c commit 46f51c9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/forge/bin/cmd/coverage.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ pub struct CoverageArgs {
6464
)]
6565
report_file: Option<PathBuf>,
6666

67+
/// Whether to include libraries in the coverage report.
68+
#[arg(long)]
69+
include_libs: bool,
70+
6771
#[command(flatten)]
6872
filter: FilterArgs,
6973

@@ -162,7 +166,8 @@ impl CoverageArgs {
162166
report.add_source(version.clone(), source_file.id as usize, path.clone());
163167

164168
// Filter out dependencies
165-
if project_paths.has_library_ancestor(std::path::Path::new(&path)) {
169+
if !self.include_libs && project_paths.has_library_ancestor(std::path::Path::new(&path))
170+
{
166171
continue
167172
}
168173

0 commit comments

Comments
 (0)