pub struct SerializableRuleConfig<L: Language> {
pub core: SerializableRuleCore,
pub id: String,
pub language: L,
pub rewriters: Option<Vec<SerializableRewriter>>,
pub message: String,
pub note: Option<String>,
pub severity: Severity,
pub labels: Option<HashMap<String, LabelConfig>>,
pub files: Option<Vec<String>>,
pub ignores: Option<Vec<String>>,
pub url: Option<String>,
pub metadata: Option<Metadata>,
}Fields§
§core: SerializableRuleCore§id: StringUnique, descriptive identifier, e.g., no-unused-variable
language: LSpecify the language to parse and the file extension to include in matching.
rewriters: Option<Vec<SerializableRewriter>>Rewrite rules for rewrite transformation
message: StringMain 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.
notes can contain markdown syntax, but it cannot reference meta-variables.
severity: SeverityOne of: hint, info, warning, or error
labels: Option<HashMap<String, LabelConfig>>Custom label dictionary to configure reporting. Key is the meta-variable name and value is the label message and label style.
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<Metadata>Extra information for the rule
Implementations§
Source§impl<L: Language> SerializableRuleConfig<L>
impl<L: Language> SerializableRuleConfig<L>
pub fn get_matcher( &self, globals: &GlobalRules, ) -> Result<RuleCore, RuleConfigError>
Methods from Deref<Target = SerializableRuleCore>§
pub fn get_matcher<L: Language>( &self, env: DeserializeEnv<L>, ) -> Result<RuleCore, RuleCoreError>
Trait Implementations§
Source§impl<L: Clone + Language> Clone for SerializableRuleConfig<L>
impl<L: Clone + Language> Clone for SerializableRuleConfig<L>
Source§fn clone(&self) -> SerializableRuleConfig<L>
fn clone(&self) -> SerializableRuleConfig<L>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<L: Language> Deref for SerializableRuleConfig<L>
impl<L: Language> Deref for SerializableRuleConfig<L>
Source§impl<L: Language> DerefMut for SerializableRuleConfig<L>
impl<L: Language> DerefMut for SerializableRuleConfig<L>
Source§impl<'de, L> Deserialize<'de> for SerializableRuleConfig<L>where
L: Deserialize<'de> + Language,
impl<'de, L> Deserialize<'de> for SerializableRuleConfig<L>where
L: Deserialize<'de> + Language,
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>,
Source§impl<L> JsonSchema for SerializableRuleConfig<L>where
L: JsonSchema + Language,
impl<L> JsonSchema for SerializableRuleConfig<L>where
L: JsonSchema + Language,
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more