pub struct LintFinding {
pub rule_id: String,
pub severity: RuleSeverity,
pub message: String,
pub file: String,
pub line: Option<u32>,
pub contract_stem: Option<String>,
pub suppressed: bool,
pub suppression_reason: Option<String>,
pub is_new: bool,
pub snippet: Option<String>,
pub suggestion: Option<String>,
pub evidence: Option<String>,
}Expand description
A single lint finding (diagnostic).
Fields§
§rule_id: String§severity: RuleSeverity§message: String§file: String§line: Option<u32>§contract_stem: Option<String>§suppressed: bool§suppression_reason: Option<String>§is_new: boolWhether this finding is new since the last lint run.
snippet: Option<String>Optional YAML source snippet showing the problematic line.
suggestion: Option<String>Suggested fix (YAML patch or instruction).
evidence: Option<String>Structured evidence supporting the finding (counterexample data, metric values).
Implementations§
Source§impl LintFinding
impl LintFinding
Sourcepub fn new(
rule_id: impl Into<String>,
severity: RuleSeverity,
message: impl Into<String>,
file: impl Into<String>,
) -> Self
pub fn new( rule_id: impl Into<String>, severity: RuleSeverity, message: impl Into<String>, file: impl Into<String>, ) -> Self
Create a new unsuppressed finding.
pub fn with_line(self, line: u32) -> Self
pub fn with_stem(self, stem: impl Into<String>) -> Self
pub fn with_snippet(self, snippet: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_evidence(self, evidence: impl Into<String>) -> Self
pub fn suppress(self, reason: impl Into<String>) -> Self
Sourcepub fn to_github_annotation(&self) -> String
pub fn to_github_annotation(&self) -> String
Format as GitHub Actions workflow command.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Fingerprint for baseline matching: (rule_id, file, message hash).
Trait Implementations§
Source§impl Clone for LintFinding
impl Clone for LintFinding
Source§fn clone(&self) -> LintFinding
fn clone(&self) -> LintFinding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LintFinding
impl Debug for LintFinding
Source§impl<'de> Deserialize<'de> for LintFinding
impl<'de> Deserialize<'de> for LintFinding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LintFinding
impl Display for LintFinding
Auto Trait Implementations§
impl Freeze for LintFinding
impl RefUnwindSafe for LintFinding
impl Send for LintFinding
impl Sync for LintFinding
impl Unpin for LintFinding
impl UnsafeUnpin for LintFinding
impl UnwindSafe for LintFinding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more