fallow_cli/health_types/
coverage.rs1use std::path::PathBuf;
2
3#[derive(Debug, Clone, serde::Serialize)]
5pub struct UntestedFile {
6 pub path: PathBuf,
8 pub value_export_count: usize,
10}
11
12#[derive(Debug, Clone, serde::Serialize)]
14pub struct UntestedExport {
15 pub path: PathBuf,
17 pub export_name: String,
19 pub line: u32,
21 pub col: u32,
23}
24
25#[derive(Debug, Clone, Default, serde::Serialize)]
27pub struct CoverageGapSummary {
28 pub runtime_files: usize,
30 pub covered_files: usize,
32 pub file_coverage_pct: f64,
34 pub untested_files: usize,
36 pub untested_exports: usize,
38}
39
40#[derive(Debug, Clone, Default, serde::Serialize)]
42pub struct CoverageGaps {
43 pub summary: CoverageGapSummary,
45 #[serde(skip_serializing_if = "Vec::is_empty")]
47 pub files: Vec<UntestedFile>,
48 #[serde(skip_serializing_if = "Vec::is_empty")]
50 pub exports: Vec<UntestedExport>,
51}
52
53impl CoverageGaps {
54 #[must_use]
55 pub fn is_empty(&self) -> bool {
56 self.files.is_empty() && self.exports.is_empty()
57 }
58}