1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
//! All of the groups of built in rules in the linter. pub mod errors; pub use errors::errors; /// Macro for easily making a rule group hashmap. /// This will call `::new()` on each rule. #[macro_export] macro_rules! group { ($(#[$description:meta])* $groupname:ident, $($path:ident::$rule:ident),* $(,)?) => { use $crate::CstRule; $( mod $path; pub use $path::$rule; )* $(#[$description])* pub fn $groupname() -> Vec<Box<dyn CstRule>> { vec![$(Box::new($rule::new()) as Box<dyn CstRule>),*] } }; }