Struct ast_grep_config::SerializableRuleConfig
source · 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 files: Option<Vec<String>>,
pub ignores: Option<Vec<String>>,
pub url: Option<String>,
pub metadata: Option<HashMap<String, String>>,
}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.
severity: SeverityOne of: hint, info, warning, or error
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§
source§impl<L: Language> SerializableRuleConfig<L>
impl<L: Language> SerializableRuleConfig<L>
pub fn get_matcher( &self, globals: &GlobalRules<L> ) -> Result<RuleCore<L>, RuleConfigError>
Methods from Deref<Target = SerializableRuleCore>§
pub fn get_matcher<L: Language>( &self, env: DeserializeEnv<L> ) -> Result<RuleCore<L>, 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>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<L: Language + JsonSchema> JsonSchema for SerializableRuleConfig<L>
impl<L: Language + JsonSchema> JsonSchema for SerializableRuleConfig<L>
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl<L> Freeze for SerializableRuleConfig<L>where
L: Freeze,
impl<L> RefUnwindSafe for SerializableRuleConfig<L>where
L: RefUnwindSafe,
impl<L> Send for SerializableRuleConfig<L>where
L: Send,
impl<L> Sync for SerializableRuleConfig<L>where
L: Sync,
impl<L> Unpin for SerializableRuleConfig<L>where
L: Unpin,
impl<L> UnwindSafe for SerializableRuleConfig<L>where
L: UnwindSafe,
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
Mutably borrows from an owned value. Read more