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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.