Skip to content

Commit b0df222

Browse files
docs: document coverage matching and correct rule ID test reference
1 parent 5f749f7 commit b0df222

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/aggregate/mod.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,13 @@ fn count_matching(findings: &[FindingLite], cov: &Coverage) -> usize {
708708
.count()
709709
}
710710

711+
/// Return whether a finding falls within the declared coverage, ignoring its claim.
712+
///
713+
/// Category names and canonical rule IDs match case-insensitively, ignoring
714+
/// non-alphanumeric characters. File coverage uses a case-sensitive substring
715+
/// match against the finding's file text before the first `:`; an empty value
716+
/// matches any present file. File coverage without file text and free-form
717+
/// coverage never match.
711718
fn matches_coverage(f: &FindingLite, cov: &Coverage) -> bool {
712719
match cov.kind {
713720
CoverageKind::Category => eq_loose(&category_name(&f.category), &cov.value),

‎src/types.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl WeakPointCategory {
489489
/// consumer reads (SARIF `ruleId`, VeriSimDB hexads, the query DSL,
490490
/// proof coverage `rule:` annotations, the verdict grid). IDs are a
491491
/// public contract: never renumber an existing category; a new category
492-
/// takes a new ID. `tests::rule_ids_are_stable` locks the table.
492+
/// takes a new ID. `rule_id_tests::rule_ids_are_stable` locks the table.
493493
pub const fn rule_id(self) -> &'static str {
494494
match self {
495495
WeakPointCategory::UncheckedAllocation => "PA001",

0 commit comments

Comments
 (0)