pub struct Finding {
pub name: String,
pub severity: RuleSeverity,
pub subject: String,
pub target: Option<String>,
pub lines: Vec<usize>,
pub graphs: Vec<String>,
pub message: String,
}Expand description
A v0.8 check finding over the composed graph. Serializes to the diagnostic
shape {name, severity, subject, target?, lines?, _graphs, message}: subject
is the implicated path (the source node for edge-level findings), target is
the edge’s destination on edge-level findings (absent on node-level ones),
lines is the source line(s) where an edge finding’s link appears (absent
otherwise), and _graphs carries the same provenance key the node or edge
does, so a consumer never has to parse anything.
Fields§
§name: String§severity: RuleSeverity§subject: String§target: Option<String>§lines: Vec<usize>§graphs: Vec<String>§message: StringImplementations§
Source§impl Finding
impl Finding
Sourcepub fn warn(
name: impl Into<String>,
subject: impl Into<String>,
graphs: Vec<String>,
message: impl Into<String>,
) -> Self
pub fn warn( name: impl Into<String>, subject: impl Into<String>, graphs: Vec<String>, message: impl Into<String>, ) -> Self
A finding at the default warn severity. The check orchestrator applies
the configured severity afterward.
Sourcepub fn with_target(self, target: impl Into<String>) -> Self
pub fn with_target(self, target: impl Into<String>) -> Self
Attach the destination path for an edge-level finding; renders as
subject → target and serializes as a target field.
Sourcepub fn with_lines(self, lines: Vec<usize>) -> Self
pub fn with_lines(self, lines: Vec<usize>) -> Self
Attach the source line(s) where an edge finding’s link appears. They
annotate the subject (subject:line → target) and serialize as lines.
The subject path itself is unchanged, so ignore globs still match it.