Struct lintrunner::lint_message::LintMessage
source · [−]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
sourceimpl Clone for LintMessage
impl Clone for LintMessage
sourcefn clone(&self) -> LintMessage
fn clone(&self) -> LintMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LintMessage
impl Debug for LintMessage
sourceimpl<'de> Deserialize<'de> for LintMessage
impl<'de> Deserialize<'de> for LintMessage
sourcefn 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
sourceimpl Serialize for LintMessage
impl Serialize for LintMessage
Auto Trait Implementations
impl RefUnwindSafe for LintMessage
impl Send for LintMessage
impl Sync for LintMessage
impl Unpin for LintMessage
impl UnwindSafe for LintMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more