Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
refactor(core): rename `insert_pattern_rule!` (#1487)
Steve Kurchfc1dbbc5f70f
diff --git a/harper-core/src/linting/lint_group.rs b/harper-core/src/linting/lint_group.rsindex c93d967eb..1344cb770 100644--- a/harper-core/src/linting/lint_group.rs+++ b/harper-core/src/linting/lint_group.rs@@ -353,7 +353,7 @@ impl LintGroup {};}- macro_rules! insert_pattern_rule {+ macro_rules! insert_expr_rule {($rule:ident, $default_config:expr) => {out.add_expr_linter(stringify!($rule), $rule::default());out.config@@ -369,93 +369,93 @@ impl LintGroup {out.merge_from(&mut initialisms::lint_group());// Add all the more complex rules to the group.- insert_pattern_rule!(APart, true);+ insert_expr_rule!(APart, true);insert_struct_rule!(AdjectiveOfA, true);insert_struct_rule!(AmInTheMorning, true);- insert_pattern_rule!(AmountsFor, true);+ insert_expr_rule!(AmountsFor, true);insert_struct_rule!(AnA, true);- insert_pattern_rule!(AnotherThingComing, true);- insert_pattern_rule!(AnotherThinkComing, false);- insert_pattern_rule!(AskNoPreposition, true);+ insert_expr_rule!(AnotherThingComing, true);+ insert_expr_rule!(AnotherThinkComing, false);+ insert_expr_rule!(AskNoPreposition, true);insert_struct_rule!(AvoidCurses, true);- insert_pattern_rule!(BackInTheDay, true);- insert_pattern_rule!(BoringWords, false);+ insert_expr_rule!(BackInTheDay, true);+ insert_expr_rule!(BoringWords, false);insert_struct_rule!(CapitalizePersonalPronouns, true);- insert_pattern_rule!(ChockFull, true);+ insert_expr_rule!(ChockFull, true);insert_struct_rule!(DiscourseMarkers, true);- insert_pattern_rule!(WayTooAdjective, true);- insert_pattern_rule!(HavePronoun, true);- insert_pattern_rule!(PronounInflectionBe, true);+ insert_expr_rule!(WayTooAdjective, true);+ insert_expr_rule!(HavePronoun, true);+ insert_expr_rule!(PronounInflectionBe, true);insert_struct_rule!(CommaFixes, true);insert_struct_rule!(CompoundNouns, true);- insert_pattern_rule!(Confident, true);+ insert_expr_rule!(Confident, true);insert_struct_rule!(CorrectNumberSuffix, true);insert_struct_rule!(CurrencyPlacement, true);- insert_pattern_rule!(Dashes, true);- insert_pattern_rule!(DespiteOf, true);- insert_pattern_rule!(DotInitialisms, true);+ insert_expr_rule!(Dashes, true);+ insert_expr_rule!(DespiteOf, true);+ insert_expr_rule!(DotInitialisms, true);insert_struct_rule!(EllipsisLength, true);insert_struct_rule!(ElsePossessive, true);insert_struct_rule!(Everyday, true);- insert_pattern_rule!(ExpandTimeShorthands, true);- insert_pattern_rule!(FewUnitsOfTimeAgo, true);+ insert_expr_rule!(ExpandTimeShorthands, true);+ insert_expr_rule!(FewUnitsOfTimeAgo, true);insert_struct_rule!(FirstAidKit, true);insert_struct_rule!(ForNoun, true);- insert_pattern_rule!(Hedging, true);- insert_pattern_rule!(Hereby, true);- insert_pattern_rule!(OpenCompounds, true);+ insert_expr_rule!(Hedging, true);+ insert_expr_rule!(Hereby, true);+ insert_expr_rule!(OpenCompounds, true);insert_struct_rule!(HopHope, true);insert_struct_rule!(HowTo, true);- insert_pattern_rule!(HyphenateNumberDay, true);+ insert_expr_rule!(HyphenateNumberDay, true);insert_struct_rule!(ItsContraction, true);- insert_pattern_rule!(LeftRightHand, true);- insert_pattern_rule!(LessWorse, true);+ insert_expr_rule!(LeftRightHand, true);+ insert_expr_rule!(LessWorse, true);insert_struct_rule!(LetsConfusion, true);- insert_pattern_rule!(Likewise, true);+ insert_expr_rule!(Likewise, true);insert_struct_rule!(LongSentences, true);insert_struct_rule!(MergeWords, true);- insert_pattern_rule!(ModalOf, true);- insert_pattern_rule!(MostNumber, true);- insert_pattern_rule!(MultipleSequentialPronouns, true);- insert_pattern_rule!(NoMatchFor, true);+ insert_expr_rule!(ModalOf, true);+ insert_expr_rule!(MostNumber, true);+ insert_expr_rule!(MultipleSequentialPronouns, true);+ insert_expr_rule!(NoMatchFor, true);insert_struct_rule!(NailOnTheHead, true);insert_struct_rule!(NominalWants, true);insert_struct_rule!(NoOxfordComma, false);- insert_pattern_rule!(Nobody, true);- insert_pattern_rule!(NounInsteadOfVerb, true);+ insert_expr_rule!(Nobody, true);+ insert_expr_rule!(NounInsteadOfVerb, true);insert_struct_rule!(NumberSuffixCapitalization, true);insert_struct_rule!(OfCourse, true);- insert_pattern_rule!(OneAndTheSame, true);- insert_pattern_rule!(OpenTheLight, true);- insert_pattern_rule!(OutOfDate, true);+ insert_expr_rule!(OneAndTheSame, true);+ insert_expr_rule!(OpenTheLight, true);+ insert_expr_rule!(OutOfDate, true);insert_struct_rule!(OxfordComma, true);- insert_pattern_rule!(Oxymorons, true);+ insert_expr_rule!(Oxymorons, true);insert_struct_rule!(PhrasalVerbAsCompoundNoun, true);- insert_pattern_rule!(PiqueInterest, true);- insert_pattern_rule!(PossessiveYour, true);+ insert_expr_rule!(PiqueInterest, true);+ insert_expr_rule!(PossessiveYour, true);insert_struct_rule!(PronounContraction, true);insert_struct_rule!(PronounKnew, true);insert_struct_rule!(RepeatedWords, true);insert_struct_rule!(SaveToSafe, true);- insert_pattern_rule!(SinceDuration, true);- insert_pattern_rule!(ShootOneselfInTheFoot, true);- insert_pattern_rule!(SomewhatSomething, true);+ insert_expr_rule!(SinceDuration, true);+ insert_expr_rule!(ShootOneselfInTheFoot, true);+ insert_expr_rule!(SomewhatSomething, true);insert_struct_rule!(Spaces, true);insert_struct_rule!(SpelledNumbers, false);- insert_pattern_rule!(ThatWhich, true);- insert_pattern_rule!(TheHowWhy, true);+ insert_expr_rule!(ThatWhich, true);+ insert_expr_rule!(TheHowWhy, true);insert_struct_rule!(TheMy, true);- insert_pattern_rule!(ThenThan, true);- insert_pattern_rule!(ThingThink, true);+ insert_expr_rule!(ThenThan, true);+ insert_expr_rule!(ThingThink, true);insert_struct_rule!(ThrowRubbish, true);- insert_pattern_rule!(Touristic, true);+ insert_expr_rule!(Touristic, true);insert_struct_rule!(UnclosedQuotes, true);- insert_pattern_rule!(UseGenitive, false);- insert_pattern_rule!(WasAloud, true);- insert_pattern_rule!(Whereas, true);- insert_pattern_rule!(WidelyAccepted, true);+ insert_expr_rule!(UseGenitive, false);+ insert_expr_rule!(WasAloud, true);+ insert_expr_rule!(Whereas, true);+ insert_expr_rule!(WidelyAccepted, true);insert_struct_rule!(WidelyAccepted, true);- insert_pattern_rule!(WinPrize, true);+ insert_expr_rule!(WinPrize, true);insert_struct_rule!(WordPressDotcom, true);out.add("SpellCheck", SpellCheck::new(dictionary.clone(), dialect));diff --git a/justfile b/justfileindex 5a408c324..a1279e5e4 100644--- a/justfile+++ b/justfile@@ -414,7 +414,7 @@ registerlinter module name:sed -i "/pub use an_a::AnA;/a pub use {{module}}::{{name}};" "$D/mod.rs"sed -i "/use super::an_a::AnA;/a use super::{{module}}::{{name}};" "$D/lint_group.rs"- sed -i "/insert_pattern_rule!(ChockFull, true);/a \ \ \ \ insert_struct_rule!({{name}}, true);" "$D/lint_group.rs"+ sed -i "/insert_expr_rule!(ChockFull, true);/a \ \ \ \ insert_struct_rule!({{name}}, true);" "$D/lint_group.rs"just format# Print affixes and their descriptions from affixes.json