//! The file subset that scopes vital signs, health scores and analysis counts.
/// Subset selector used when scoping `vital_signs`, `health_score`, and
/// `analysis_counts` to a workspace package or a `--group-by` bucket.
///
/// `Full` skips filtering entirely (project-wide). `Paths` matches files whose
/// absolute path is in the given set (exact match), which is what scoped
/// project runs and `--group-by` use to keep every score input on the same
/// filtered file set.
pub enum SubsetFilter<'a> {
Full,
Paths(&'a rustc_hash::FxHashSet<std::path::PathBuf>),
}
impl SubsetFilter<'_> {
pub fn is_full(&self) -> bool {
matches!(self, Self::Full)
}
pub fn matches(&self, path: &std::path::Path) -> bool {
match self {
Self::Full => true,
Self::Paths(set) => set.contains(path),
}
}
}