Initial implementation of policy coverage (#146)

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2024-02-18 22:16:53 -08:00
committed by GitHub
parent bdb2aba596
commit f3d9652a73
12 changed files with 451 additions and 19 deletions

View File

@@ -339,6 +339,21 @@ impl std::fmt::Debug for dyn Extension {
}
}
#[cfg(feature = "coverage")]
pub mod coverage {
#[derive(Default, serde::Serialize, serde::Deserialize, Eq, PartialEq)]
pub struct PolicyFile {
pub path: String,
pub code: String,
pub uncovered: std::collections::BTreeSet<u32>,
}
#[derive(Default, serde::Serialize, serde::Deserialize, Eq, PartialEq)]
pub struct Report {
pub files: Vec<PolicyFile>,
}
}
/// Items in `unstable` are likely to change.
#[doc(hidden)]
pub mod unstable {