pub struct LintMessage {
pub path: Option<String>,
pub line: Option<usize>,
pub char: Option<usize>,
pub code: String,
pub severity: LintSeverity,
pub name: String,
pub description: Option<String>,
pub original: Option<String>,
pub replacement: Option<String>,
}
Expand description
Represents a single lint message. This version of the struct is used as the canonical protocol representation, intended to be serialized directly into JSON.
Fields§
§path: Option<String>
Path to the file this lint message pertains to.
This can either be an absolute path, or relative to the current working
directory when lintrunner
was invoked.
When the path is None, this message will be displayed as a general linter error.
line: Option<usize>
The line number that the lint message pertains to.
char: Option<usize>
The column number that the lint message pertains to.
code: String
Linter code (e.g. FLAKE8
). Must match the code specified in the linter config.
severity: LintSeverity
The severity of the lint message.
name: String
The name of the type of lint message, e.g. “syntax error”
description: Option<String>
A more substantive description of the lint message. This can include suggestions for remediation, links to further documentation, etc.
original: Option<String>
The original text of the entire file, encoded as a utf-8 string.
replacement: Option<String>
If a fix was suggested, this is the replacement text of the entire file, encoded as a utf-8 string.
Trait Implementations§
Source§impl Clone for LintMessage
impl Clone for LintMessage
Source§fn clone(&self) -> LintMessage
fn clone(&self) -> LintMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LintMessage
impl Debug for LintMessage
Source§impl<'de> Deserialize<'de> for LintMessage
impl<'de> Deserialize<'de> for LintMessage
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>,
Auto Trait Implementations§
impl Freeze for LintMessage
impl RefUnwindSafe for LintMessage
impl Send for LintMessage
impl Sync for LintMessage
impl Unpin for LintMessage
impl UnwindSafe for LintMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more