pub struct LintFinding {
pub kind: LintKind,
pub severity: LintSeverity,
pub message: String,
pub line: usize,
pub col: usize,
pub suggest: Option<String>,
}Expand description
One parse-time finding. Carries a 1-based (line, col) anchor in the source so downstream tools can surface a diagnostic at the exact byte where the legacy shape lives.
Fields§
§kind: LintKindCategory bucket.
severity: LintSeveritySeverity tier.
message: StringHuman-readable description.
line: usize1-based line number in the source.
col: usize1-based column.
suggest: Option<String>Suggested replacement text (Some("{$count}") for the bare
interpolation rule). None when no machine-applicable fix is
available.
Implementations§
Source§impl LintFinding
impl LintFinding
Sourcepub fn render(&self, file: &Path) -> String
pub fn render(&self, file: &Path) -> String
Render the finding as the stderr diagnostic the compile paths
print: one severity-prefixed line anchored at file:line:col,
plus a hint: line when the rule carries a machine-applicable
fix. Every path that compiles markup from source calls this, so
check, run and build cannot drift apart on the wording.
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 (const: unstable) · 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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.