E0000 Example Rule can be used as a base for any new rules. Please follow the next steps to add a new rule:
E1234
. cp src/rules/e0.rs src/rules/e1234.rs
CODE
and DESCRIPTION
variables in the new src/rules/e1234.rs
:
...
static CODE: &str = "E1234";
static DESCRIPTION: &str = "Your rule description";
...
cp -r src/rules/examples/e0 src/rules/examples/e1234
validate
function in src/rules/e1234.rs
. And cover it with tests in mod tests
.src/rules/mod.rs
:
...
pub mod e1234;
...
pub fn all_rules() -> HashMap<String, Box<dyn Rule>> {
...
add_rule(&mut rules, Box::default() as Box<e1234::Rule>);
...
}
README.md
with new rule details.