Trait rslint_core::Rule[][src]

pub trait Rule: Debug + DynClone + Send + Sync {
    fn name(&self) -> &'static str;
fn group(&self) -> &'static str; fn docs(&self) -> &'static str { ... }
fn tags(&self) -> &'static [Tag] { ... }
fn recommended(&self) -> bool { ... } }
Expand description

A generic trait which describes things common to a rule regardless on what they run on.

Each rule should have a new function for easy instantiation. We however do not require this for the purposes of allowing more complex rules to instantiate themselves in a different way. However the rules must be easily instantiated because of rule groups.

Required methods

A unique, kebab-case name for the rule.

The name of the group this rule belongs to.

Provided methods

Optional docs for the rule, an empty string by default

A list of tags present on this rule. Empty by default.

Whether this rule is recommended, this is a simple helper around Self::tags.