pub struct RuleConfig<L: Language> {
    pub id: String,
    pub message: String,
    pub note: Option<String>,
    pub severity: Severity,
    pub language: L,
    pub rule: SerializableRule,
    pub fix: Option<String>,
    pub constraints: Option<HashMap<String, SerializableMetaVarMatcher>>,
    pub files: Option<Vec<String>>,
    pub ignores: Option<Vec<String>>,
    pub url: Option<String>,
    pub metadata: Option<HashMap<String, String>>,
}

Fields

id: String

Unique, descriptive identifier, e.g., no-unused-variable

message: String

Main message highlighting why this rule fired. It should be single line and concise, but specific enough to be understood without additional context.

note: Option<String>

Additional notes to elaborate the message and provide potential fix to the issue.

severity: Severity

One of: Info, Warning, or Error

language: L

Specify the language to parse and the file extension to includ in matching.

rule: SerializableRule

Pattern rules to find matching AST nodes

fix: Option<String>

A pattern to auto fix the issue. It can reference metavariables appeared in rule.

constraints: Option<HashMap<String, SerializableMetaVarMatcher>>

Addtional meta variables pattern to filter matching

files: Option<Vec<String>>

Glob patterns to specify that the rule only applies to matching files

ignores: Option<Vec<String>>

Glob patterns that exclude rules from applying to files

url: Option<String>

Documentation link to this rule

metadata: Option<HashMap<String, String>>

Extra information for the rule

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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
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.