Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
doc(core): document `lint_group` macros (#1568)
Elijah Potter698e27ad945e
diff --git a/harper-core/src/linting/lint_group.rs b/harper-core/src/linting/lint_group.rsindex 0a1c82112..ea09c2779 100644--- a/harper-core/src/linting/lint_group.rs+++ b/harper-core/src/linting/lint_group.rs@@ -353,6 +353,7 @@ impl LintGroup {pub fn new_curated(dictionary: Arc<impl Dictionary + 'static>, dialect: Dialect) -> Self {let mut out = Self::empty();+ /// Add a `Linter` to the group, setting it to be enabled by default.macro_rules! insert_struct_rule {($rule:ident, $default_config:expr) => {out.add(stringify!($rule), $rule::default());@@ -361,6 +362,9 @@ impl LintGroup {};}+ /// Add an `ExprLinter` to the group, setting it to be enabled by default.+ /// While you _can_ pass an `ExprLinter` to `insert_struct_rule`, using this macro instead+ /// will allow it to use more aggressive caching strategies.macro_rules! insert_expr_rule {($rule:ident, $default_config:expr) => {out.add_expr_linter(stringify!($rule), $rule::default());