Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat(core): create pool of instantiated linters to amortize construction cost (#3904)
Elijah Potterc16a61fa9091
diff --git a/Cargo.lock b/Cargo.lockindex f82ccd59c..ec455ba96 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -609,6 +609,12 @@ dependencies = ["piper",]+[[package]]+name = "boxcar"+version = "0.2.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "36f64beae40a84da1b4b26ff2761a5b895c12adc41dc25aaee1c4f2bbfe97a6e"+[[package]]name = "brotli"version = "8.0.2"@@ -4255,6 +4261,7 @@ dependencies = ["ammonia","bitflags 2.11.0","blanket",+ "boxcar","cached 0.59.0","criterion","foldhash 0.2.0",@@ -9203,7 +9210,6 @@ dependencies = ["bytes","libc","mio",- "parking_lot","pin-project-lite","signal-hook-registry","socket2",diff --git a/harper-core/Cargo.toml b/harper-core/Cargo.tomlindex 43a4593ec..dec5d9d37 100644--- a/harper-core/Cargo.toml+++ b/harper-core/Cargo.toml@@ -36,6 +36,7 @@ bitflags = { version = "2.11.0", features = ["serde"] }trie-rs = "0.4.2"zip = { version = "8.6.0", default-features = false, features = ["deflate"] }regex = "1.12.3"+boxcar = { version = "0.2.14", optional = true }[dev-dependencies]criterion = { version = "0.8.2", default-features = false }@@ -53,6 +54,6 @@ name = "spellcheck"harness = false[features]-default = ["thesaurus"]-concurrent = []+default = ["thesaurus", "concurrent"]+concurrent = ["dep:boxcar"]thesaurus = ["dep:harper-thesaurus"]diff --git a/harper-core/src/ignored_lints/mod.rs b/harper-core/src/ignored_lints/mod.rsindex 02eb0cca8..d7bafce3b 100644--- a/harper-core/src/ignored_lints/mod.rs+++ b/harper-core/src/ignored_lints/mod.rs@@ -61,18 +61,24 @@ mod tests {use quickcheck_macros::quickcheck;use super::IgnoredLints;+ use crate::linting::create_test_pool;use crate::spell::FstDictionary;use crate::{Dialect, Document,linting::{LintGroup, Linter},};+ create_test_pool!(+ LintGroup,+ LintGroup,+ LintGroup::new_curated(FstDictionary::curated(), Dialect::American)+ );+#[quickcheck]fn can_ignore_all(text: String) -> bool {let document = Document::new_markdown_default_curated(&text);- let mut lints =- LintGroup::new_curated(FstDictionary::curated(), Dialect::American).lint(&document);+ let mut lints = test_linter().lint(&document);let mut ignored = IgnoredLints::new();@@ -88,8 +94,7 @@ mod tests {fn can_ignore_first(text: String) -> TestResult {let document = Document::new_markdown_default_curated(&text);- let mut lints =- LintGroup::new_curated(FstDictionary::curated(), Dialect::American).lint(&document);+ let mut lints = test_linter().lint(&document);let Some(first) = lints.first().cloned() else {return TestResult::discard();@@ -107,8 +112,7 @@ mod tests {fn assert_ignore_lint_reduction(source: &str, nth_lint: usize) {let document = Document::new_markdown_default_curated(source);- let mut lints =- LintGroup::new_curated(FstDictionary::curated(), Dialect::American).lint(&document);+ let mut lints = test_linter().lint(&document);let nth = lints.get(nth_lint).cloned().unwrap_or_else(|| {panic!("If ignoring the lint at {nth_lint}, make sure there are enough problems.")diff --git a/harper-core/src/lib.rs b/harper-core/src/lib.rsindex cbcf4b501..25624e4d6 100644--- a/harper-core/src/lib.rs+++ b/harper-core/src/lib.rs@@ -208,7 +208,7 @@ mod tests {use itertools::Itertools;use quickcheck_macros::quickcheck;- use crate::linting::Lint;+ use crate::linting::{Lint, create_test_pool};use crate::remove_overlaps_map;use crate::spell::FstDictionary;use crate::{@@ -218,11 +218,17 @@ mod tests {remove_lints_overlapping_expr, remove_overlaps,};+ create_test_pool!(+ LintGroup,+ LintGroup,+ LintGroup::new_curated(FstDictionary::curated(), Dialect::American)+ );+#[test]fn keeps_space_lint() {let doc = Document::new_plain_english_curated("Ths tet");- let mut linter = LintGroup::new_curated(FstDictionary::curated(), Dialect::American);+ let mut linter = test_linter();let mut lints = linter.lint(&doc);@@ -275,9 +281,9 @@ mod tests {#[quickcheck]fn overlap_removals_have_equivalent_behavior(s: String) {let doc = Document::new_plain_english_curated(&s);- let mut linter = LintGroup::new_curated(FstDictionary::curated(), Dialect::American);+ let linter = test_linter();- let mut lint_map = linter.organized_lints(&doc);+ let mut lint_map = linter.run_with_inner(|l| l.organized_lints(&doc));let mut lint_flat: Vec<_> = lint_map.values().flatten().cloned().collect();remove_overlaps_map(&mut lint_map);diff --git a/harper-core/src/linting/be_adjective_confusions.rs b/harper-core/src/linting/be_adjective_confusions.rsindex db07878ef..d2b5e9359 100644--- a/harper-core/src/linting/be_adjective_confusions.rs+++ b/harper-core/src/linting/be_adjective_confusions.rs@@ -128,16 +128,22 @@ pub fn lint_group() -> LintGroup {#[cfg(test)]mod tests {+ use super::lint_group;+ use crate::linting::LintGroup;+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(LintGroup, LintGroup, lint_group());+mod biased {use crate::linting::tests::{assert_no_lints, assert_suggestion_result};- use super::super::lint_group;+ use super::test_linter;#[test]fn he_s_bias() {assert_suggestion_result("he's just on a rush to write a rejection letter probably because he's bias toward the origin or affiliation of the author",- lint_group(),+ test_linter(),"he's just on a rush to write a rejection letter probably because he's biased toward the origin or affiliation of the author",);}@@ -146,7 +152,7 @@ mod tests {fn i_am_bias() {assert_suggestion_result("I guess I am bias/prefer udd-style fragments",- lint_group(),+ test_linter(),"I guess I am biased/prefer udd-style fragments",);}@@ -155,7 +161,7 @@ mod tests {fn i_m_bias() {assert_suggestion_result("I'm bias towards vunit as it's by far the most user friendly HDL test runner I know of.",- lint_group(),+ test_linter(),"I'm biased towards vunit as it's by far the most user friendly HDL test runner I know of.",);}@@ -164,7 +170,7 @@ mod tests {fn im_bias() {assert_suggestion_result("im bias, cause thats all im here for",- lint_group(),+ test_linter(),"im biased, cause thats all im here for",);}@@ -173,7 +179,7 @@ mod tests {fn they_re_bias() {assert_suggestion_result("See, I told you they’re bias because they flagged my comment!",- lint_group(),+ test_linter(),"See, I told you they’re biased because they flagged my comment!",);}@@ -183,7 +189,7 @@ mod tests {fn they_re_bias_could_also_be_their_bias() {assert_suggestion_result("As a general rule I try to steer clear of the major news media outlets because of their outright refusal to admit they're bias upfront.",- lint_group(),+ test_linter(),"As a general rule I try to steer clear of the major news media outlets because of their outright refusal to admit they're biased upfront.",);}@@ -193,7 +199,7 @@ mod tests {fn were_bias() {assert_suggestion_result("the generated sample were bias in presence of negative cross-section",- lint_group(),+ test_linter(),"the generated sample were biased in presence of negative cross-section",);}@@ -202,14 +208,14 @@ mod tests {#[test]fn dont_flag_bias_hyphen_corrected() {- assert_no_lints("I gather they are bias-corrected estimates.", lint_group());+ assert_no_lints("I gather they are bias-corrected estimates.", test_linter());}#[test]fn dont_flag_bias_space_corrected() {assert_no_lints("All the images were bias corrected using N4 algorithm with a threshold value of 0.001.",- lint_group(),+ test_linter(),);}@@ -217,7 +223,7 @@ mod tests {fn dont_flag_its_bias_free() {assert_no_lints("Both the original model, and its bias-free counterpart, will be loaded.",- lint_group(),+ test_linter(),);}@@ -225,7 +231,7 @@ mod tests {fn dont_flag_if_there_were_bias() {assert_no_lints("which depend on several variables: if there were bias, the average size of the classes, as well as the number of teachers at the school",- lint_group(),+ test_linter(),);}}@@ -233,13 +239,13 @@ mod tests {mod concerned {use crate::linting::tests::{assert_no_lints, assert_suggestion_result};- use super::super::lint_group;+ use super::test_linter;#[test]fn hes_concern() {assert_suggestion_result("He's concern about my mental health because I'm alone in this city",- lint_group(),+ test_linter(),"He's concerned about my mental health because I'm alone in this city",);}@@ -248,7 +254,7 @@ mod tests {fn i_am_concern() {assert_suggestion_result("I am learning to use this, but I am concern on data privacy and sharing issues.",- lint_group(),+ test_linter(),"I am learning to use this, but I am concerned on data privacy and sharing issues.",);}@@ -257,7 +263,7 @@ mod tests {fn im_concern() {assert_suggestion_result("I'm concern if there is missing CVEs.",- lint_group(),+ test_linter(),"I'm concerned if there is missing CVEs.",);}@@ -266,7 +272,7 @@ mod tests {fn im_no_apostrophe_concern() {assert_suggestion_result("The only thing im concern about is the crash.",- lint_group(),+ test_linter(),"The only thing im concerned about is the crash.",);}@@ -276,7 +282,7 @@ mod tests {fn its_no_apostrophe_concern() {assert_suggestion_result("yes no one there answered and I thought its concern with this repo too so I clone it here!",- lint_group(),+ test_linter(),"yes no one there answered and I thought its concerned with this repo too so I cloned it here!",);}@@ -285,7 +291,7 @@ mod tests {fn shes_concern() {assert_suggestion_result("she often courier food to her 40 year old son living in Jeju island because she’s concern about her son’s well being",- lint_group(),+ test_linter(),"she often courier food to her 40 year old son living in Jeju island because she’s concerned about her son’s well being",);}@@ -294,7 +300,7 @@ mod tests {fn were_concern() {assert_suggestion_result("As far as we're concern, this is a very simple try catch on your end",- lint_group(),+ test_linter(),"As far as we're concerned, this is a very simple try catch on your end",);}@@ -303,7 +309,7 @@ mod tests {fn we_are_concern() {assert_suggestion_result("We are concern and prioritize users' feedback and maintainability.",- lint_group(),+ test_linter(),"We are concerned and prioritize users' feedback and maintainability.",);}@@ -312,7 +318,7 @@ mod tests {fn you_are_concern() {assert_suggestion_result("you are concern only in logging a more appropriate message error, but continue to throw the opaque assertion error.",- lint_group(),+ test_linter(),"you are concerned only in logging a more appropriate message error, but continue to throw the opaque assertion error.",);}@@ -323,25 +329,25 @@ mod tests {fn dont_flag_noun_concern() {assert_no_lints("My main concern is the data that could be lost using this deletion.",- lint_group(),+ test_linter(),);}#[test]fn dont_flag_verb_concern() {- assert_no_lints("This doesn't concern me at all.", lint_group());+ assert_no_lints("This doesn't concern me at all.", test_linter());}#[test]fn dont_flag_concern_free() {- assert_no_lints("They don't pretend they're concern-free.", lint_group());+ assert_no_lints("They don't pretend they're concern-free.", test_linter());}#[test]fn dont_flag_legit_its_concern() {assert_no_lints("The ByteBlockPool loses its reference to the buffers it's just zeroed, so it seems outside its concern to zero the buffers.",- lint_group(),+ test_linter(),);}@@ -350,7 +356,7 @@ mod tests {fn dont_flag_youre_your_error() {assert_no_lints("You're concern then is literally the \"-like\" in the message?",- lint_group(),+ test_linter(),);}}@@ -358,13 +364,13 @@ mod tests {mod prejudiced {use crate::linting::tests::assert_suggestion_result;- use super::super::lint_group;+ use super::test_linter;#[test]fn i_was_prejudice() {assert_suggestion_result("I didn't know I was prejudice against some of my own people until I went looking for web framework documentation and was met with a BLM banner.",- lint_group(),+ test_linter(),"I didn't know I was prejudiced against some of my own people until I went looking for web framework documentation and was met with a BLM banner.",);}@@ -373,7 +379,7 @@ mod tests {fn shes_prejudice() {assert_suggestion_result("She's prejudice against muslims.",- lint_group(),+ test_linter(),"She's prejudiced against muslims.",);}@@ -382,7 +388,7 @@ mod tests {fn theyre_prejudice() {assert_suggestion_result("The people who manage the law are all about lying and tricking people, theyre prejudice and trying to make people look stupid",- lint_group(),+ test_linter(),"The people who manage the law are all about lying and tricking people, theyre prejudiced and trying to make people look stupid",);}@@ -391,13 +397,13 @@ mod tests {mod shocked {use crate::linting::tests::{assert_no_lints, assert_suggestion_result};- use super::super::lint_group;+ use super::test_linter;#[test]fn we_were_shock() {assert_suggestion_result("We were shock because its working fine on 1st of April just after 3 days its not working with the same settings, that is our major concern.",- lint_group(),+ test_linter(),"We were shocked because its working fine on 1st of April just after 3 days its not working with the same settings, that is our major concern.",);}@@ -408,7 +414,7 @@ mod tests {fn dont_flag_shock_jocks() {assert_no_lints("They're not commentators/anaylsts, they're shock jocks.",- lint_group(),+ test_linter(),);}@@ -417,7 +423,7 @@ mod tests {fn dont_flag_were_shock() {assert_no_lints("My first reactions when the topic of cryonics came up (early in our relationship) were shock, a bit of revulsion, and a lot of confusion.",- lint_group(),+ test_linter(),);}}@@ -427,13 +433,13 @@ mod tests {assert_good_and_bad_suggestions, assert_no_lints, assert_suggestion_result,};- use super::super::lint_group;+ use super::test_linter;#[test]fn he_is_worry() {assert_suggestion_result("I guess he is worry about \" * user * \" tag.",- lint_group(),+ test_linter(),"I guess he is worried about \" * user * \" tag.",);}@@ -442,7 +448,7 @@ mod tests {fn he_was() {assert_suggestion_result("So he was worry about her. Especially, when he got no response by calling her on her phone nor ranging her doorbell.",- lint_group(),+ test_linter(),"So he was worried about her. Especially, when he got no response by calling her on her phone nor ranging her doorbell.",);}@@ -451,7 +457,7 @@ mod tests {fn i_am_worry() {assert_suggestion_result("I didn't see any section dedicated to this so I am worry about:",- lint_group(),+ test_linter(),"I didn't see any section dedicated to this so I am worried about:",);}@@ -460,7 +466,7 @@ mod tests {fn im_worry() {assert_suggestion_result("but I'm worry about memory leak caused by that long delay",- lint_group(),+ test_linter(),"but I'm worried about memory leak caused by that long delay",);}@@ -469,7 +475,7 @@ mod tests {fn im_no_apostrophe_worry() {assert_suggestion_result("im worry now that if this inbound was dangerous and maybe it does something to my pc",- lint_group(),+ test_linter(),"im worried now that if this inbound was dangerous and maybe it does something to my pc",);}@@ -478,7 +484,7 @@ mod tests {fn i_was() {assert_suggestion_result("So that's why I was worry.",- lint_group(),+ test_linter(),"So that's why I was worried.",);}@@ -487,7 +493,7 @@ mod tests {fn i_were() {assert_suggestion_result("The only things that I were worry about is the data that could be lost using this deletion.",- lint_group(),+ test_linter(),"The only things that I were worried about is the data that could be lost using this deletion.",);}@@ -496,7 +502,7 @@ mod tests {fn they_are_worry() {assert_suggestion_result("at the same time they are worry about the price for the upgrade each 3 years",- lint_group(),+ test_linter(),"at the same time they are worried about the price for the upgrade each 3 years",);}@@ -505,7 +511,7 @@ mod tests {fn theyre_worry() {assert_suggestion_result("Because they're worry this link is spam or they scare have to pay more money.",- lint_group(),+ test_linter(),"Because they're worried this link is spam or they scare have to pay more money.",);}@@ -514,7 +520,7 @@ mod tests {fn we_are() {assert_suggestion_result("We are analised this and we are worry because when our platform go to market",- lint_group(),+ test_linter(),"We are analised this and we are worried because when our platform go to market",);}@@ -523,7 +529,7 @@ mod tests {fn were() {assert_suggestion_result("We're worry about all kinds of minority representation in TV.",- lint_group(),+ test_linter(),"We're worried about all kinds of minority representation in TV.",);}@@ -532,7 +538,7 @@ mod tests {fn you_are() {assert_suggestion_result("You are worry because we are not annotating view interface itself, right?",- lint_group(),+ test_linter(),"You are worried because we are not annotating view interface itself, right?",);}@@ -541,7 +547,7 @@ mod tests {fn youre() {assert_suggestion_result("You're worry about memory usage and wanna be sure that a Sequence-class won't hold your activity against GC — declare this class as static",- lint_group(),+ test_linter(),"You're worried about memory usage and wanna be sure that a Sequence-class won't hold your activity against GC — declare this class as static",);}@@ -552,7 +558,7 @@ mod tests {fn dont_flag_it_is() {assert_no_lints("Part of it is worry that my bosses will get angry and fire me.",- lint_group(),+ test_linter(),);}@@ -560,30 +566,30 @@ mod tests {fn dont_flag_it_was() {assert_no_lints("Because what followed wasn't indifference, it was worry.",- lint_group(),+ test_linter(),);}#[test]fn dont_flag_she_was_worry_free() {- assert_no_lints("Finally, she was worry-free.", lint_group());+ assert_no_lints("Finally, she was worry-free.", test_linter());}#[test]fn dont_flag_theyre_worry_free() {- assert_no_lints("They don't pretend they're worry-free.", lint_group());+ assert_no_lints("They don't pretend they're worry-free.", test_linter());}#[test]fn dont_flag_worry_warts() {- assert_no_lints("They’re worry warts", lint_group());+ assert_no_lints("They’re worry warts", test_linter());}#[test]fn dont_flag_were_worry_space_free() {assert_no_lints("Thanks to jQuery, we're worry free from browser compatibility.",- lint_group(),+ test_linter(),);}@@ -592,7 +598,7 @@ mod tests {fn different_case_not_handled() {assert_good_and_bad_suggestions("Myself along with others are using it on an iPad successfully, so it is worry to hear that is broken for you.",- lint_group(),+ test_linter(),&["Myself along with others are using it on an iPad successfully, so it is worrying to hear that is broken for you.","Myself along with others are using it on an iPad successfully, so it is a worry to hear that is broken for you.",@@ -604,7 +610,10 @@ mod tests {#[test]#[ignore = "This is a different error that should be caught by `ShouldContract`"]fn dont_flag_youre_youre_error() {- assert_no_lints("I think you're worry is not really an issue.", lint_group());+ assert_no_lints(+ "I think you're worry is not really an issue.",+ test_linter(),+ );}}}diff --git a/harper-core/src/linting/compound_nouns/compound_noun_after_possessive.rs b/harper-core/src/linting/compound_nouns/compound_noun_after_possessive.rsindex b0ffd8bbc..1099e18f6 100644--- a/harper-core/src/linting/compound_nouns/compound_noun_after_possessive.rs+++ b/harper-core/src/linting/compound_nouns/compound_noun_after_possessive.rs@@ -90,23 +90,26 @@ impl ExprLinter for CompoundNounAfterPossessive {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(+ CompoundNounAfterPossessive,+ CompoundNounAfterPossessive,+ CompoundNounAfterPossessive::default()+ );use super::CompoundNounAfterPossessive;use crate::linting::tests::assert_lint_count;#[test]fn lets_is_not_possessive() {- assert_lint_count(- "Let's check out this article.",- CompoundNounAfterPossessive::default(),- 0,- );+ assert_lint_count("Let's check out this article.", test_linter(), 0);}#[test]fn lets_is_not_possessive_typographic_apostrophe() {assert_lint_count("“Let’s go on with the game,” the Queen said to Alice;",- CompoundNounAfterPossessive::default(),+ test_linter(),0,)}@@ -115,7 +118,7 @@ mod tests {fn thats_is_not_possessive() {assert_lint_count("And you might not be thinking that that's a very big issue, but ...",- CompoundNounAfterPossessive::default(),+ test_linter(),0,);}diff --git a/harper-core/src/linting/compound_nouns/mod.rs b/harper-core/src/linting/compound_nouns/mod.rsindex e7f2642ec..d4b3de496 100644--- a/harper-core/src/linting/compound_nouns/mod.rs+++ b/harper-core/src/linting/compound_nouns/mod.rs@@ -32,6 +32,9 @@ merge_linters!(CompoundNouns => CompoundNounAfterDetAdj, CompoundNounBeforeAuxVe#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(CompoundNouns, CompoundNouns, CompoundNouns::default());use super::CompoundNouns;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};@@ -39,175 +42,175 @@ mod tests {fn web_cam() {let test_sentence = "The web cam captured a stunning image.";let expected = "The webcam captured a stunning image.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn note_book() {let test_sentence = "She always carries a note book to jot down ideas.";let expected = "She always carries a notebook to jot down ideas.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn mother_board() {let test_sentence = "After the upgrade, the mother board was replaced.";let expected = "After the upgrade, the motherboard was replaced.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn smart_phone() {let test_sentence = "He bought a new smart phone last week.";let expected = "He bought a new smartphone last week.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn firm_ware() {let test_sentence = "The device's firm ware was updated overnight.";let expected = "The device's firmware was updated overnight.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn back_plane() {let test_sentence = "A reliable back plane is essential for high-speed data transfer.";let expected = "A reliable backplane is essential for high-speed data transfer.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn spread_sheet() {let test_sentence = "The accountant reviewed the spread sheet carefully.";let expected = "The accountant reviewed the spreadsheet carefully.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn side_bar() {let test_sentence = "The website's side bar offers quick navigation links.";let expected = "The website's sidebar offers quick navigation links.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn back_pack() {let test_sentence = "I packed my books in my back pack before leaving.";let expected = "I packed my books in my backpack before leaving.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn cup_board() {let test_sentence = "She stored the dishes in the old cup board.";let expected = "She stored the dishes in the old cupboard.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn key_board() {let test_sentence = "My key board stopped working during the meeting.";let expected = "My keyboard stopped working during the meeting.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn touch_screen() {let test_sentence = "The device features a responsive touch screen.";let expected = "The device features a responsive touchscreen.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn head_set() {let test_sentence = "He bought a new head set for his workouts.";let expected = "He bought a new headset for his workouts.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn frame_work() {let test_sentence = "The frame work of the app was built with care.";let expected = "The framework of the app was built with care.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn touch_pad() {let test_sentence = "The touch pad on my laptop is very sensitive.";let expected = "The touchpad on my laptop is very sensitive.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn micro_processor() {let test_sentence = "This micro processor is among the fastest available.";let expected = "This microprocessor is among the fastest available.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn head_phone() {let test_sentence = "I lost my head phone at the gym.";let expected = "I lost my headphone at the gym.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn micro_services() {let test_sentence = "Our architecture now relies on micro services.";let expected = "Our architecture now relies on microservices.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn dash_board() {let test_sentence = "The dash board shows real-time analytics.";let expected = "The dashboard shows real-time analytics.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn site_map() {let test_sentence = "A site map is provided at the footer of the website.";let expected = "A sitemap is provided at the footer of the website.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn fire_wall() {let test_sentence = "A robust fire wall is essential for network security.";let expected = "A robust firewall is essential for network security.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn bit_stream() {let test_sentence = "The bit stream was interrupted during transmission.";let expected = "The bitstream was interrupted during transmission.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn block_chain() {let test_sentence = "The block chain is revolutionizing the financial sector.";let expected = "The blockchain is revolutionizing the financial sector.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn thumb_nail() {let test_sentence = "I saved the image as a thumb nail.";let expected = "I saved the image as a thumbnail.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn bath_room() {let test_sentence = "They remodeled the bath room entirely.";let expected = "They remodeled the bathroom entirely.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]@@ -215,102 +218,90 @@ mod tests {fn every_one() {let test_sentence = "Every one should have access to quality education.";let expected = "Everyone should have access to quality education.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn play_ground() {let test_sentence = "The kids spent the afternoon at the play ground.";let expected = "The kids spent the afternoon at the playground.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn run_way() {let test_sentence = "The airplane taxied along the run way.";let expected = "The airplane taxied along the runway.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn cyber_space() {let test_sentence = "Hackers roam the cyber space freely.";let expected = "Hackers roam the cyberspace freely.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn cyber_attack() {let test_sentence = "The network was hit by a cyber attack.";let expected = "The network was hit by a cyberattack.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn web_socket() {let test_sentence = "Real-time updates are sent via a web socket.";let expected = "Real-time updates are sent via a websocket.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn finger_print() {let test_sentence = "The detective collected a finger print as evidence.";let expected = "The detective collected a fingerprint as evidence.";- assert_suggestion_result(test_sentence, CompoundNouns::default(), expected);+ assert_suggestion_result(test_sentence, test_linter(), expected);}#[test]fn got_is_not_possessive() {- assert_lint_count("I got here by car...", CompoundNouns::default(), 0);+ assert_lint_count("I got here by car...", test_linter(), 0);}#[test]fn allow_issue_662() {- assert_lint_count(- "They are as old as *modern* computers ",- CompoundNouns::default(),- 0,- );+ assert_lint_count("They are as old as *modern* computers ", test_linter(), 0);}#[test]fn allow_issue_661() {- assert_lint_count("I may be wrong.", CompoundNouns::default(), 0);+ assert_lint_count("I may be wrong.", test_linter(), 0);}#[test]fn allow_issue_704() {- assert_lint_count(- "Here are some ways to do that:",- CompoundNouns::default(),- 0,- );+ assert_lint_count("Here are some ways to do that:", test_linter(), 0);}#[test]fn allows_issue_721() {assert_lint_count("So if you adjust any one of these adjusters that can have a negative or a positive effect.",- CompoundNouns::default(),+ test_linter(),0,);}#[test]fn allows_678() {- assert_lint_count(- "they can't catch all the bugs.",- CompoundNouns::default(),- 0,- );+ assert_lint_count("they can't catch all the bugs.", test_linter(), 0);}#[test]fn ina_not_suggested() {assert_lint_count("past mistakes or a character in a looping reality facing personal challenges.",- CompoundNouns::default(),+ test_linter(),0,);}@@ -319,7 +310,7 @@ mod tests {fn allow_suppress_or() {assert_lint_count("He must decide whether to suppress or coexist with his doppelgänger.",- CompoundNouns::default(),+ test_linter(),0,);}@@ -328,7 +319,7 @@ mod tests {fn allow_an_arm_and_a_leg() {assert_lint_count("I have to pay an arm and a leg get a worker to come and be my assistant baker.",- CompoundNouns::default(),+ test_linter(),0,);}@@ -337,21 +328,21 @@ mod tests {fn allow_well_and_723() {assert_lint_count("I understood very well and decided to go.",- CompoundNouns::default(),+ test_linter(),0,);}#[test]fn allow_can_not() {- assert_lint_count("Size can not be determined.", CompoundNouns::default(), 0);+ assert_lint_count("Size can not be determined.", test_linter(), 0);}#[test]fn dont_flag_lot_to() {assert_lint_count("but you'd have to raise taxes a lot to do it.",- CompoundNouns::default(),+ test_linter(),0,);}@@ -360,7 +351,7 @@ mod tests {fn dont_flag_to_me() {assert_lint_count("There's no massive damage to the rockers or anything that to me would indicate that like the whole front of the car was off",- CompoundNouns::default(),+ test_linter(),0,);}@@ -369,23 +360,20 @@ mod tests {fn allow_issue_1553() {assert_no_lints("I'm not sure if there's anyone else that may be interested in more fine-grained control, but as it stands, having the domain level toggle is sufficient for me.",- CompoundNouns::default(),+ test_linter(),);}#[test]fn allow_issue_1496() {- assert_no_lints(- "I am not able to respond to messages.",- CompoundNouns::default(),- );+ assert_no_lints("I am not able to respond to messages.", test_linter());}#[test]fn allow_issue_1298() {assert_no_lints("A series of tests that cover all possible cases.",- CompoundNouns::default(),+ test_linter(),);}@@ -393,7 +381,7 @@ mod tests {fn dont_flag_project_or() {assert_no_lints("You can star or watch this project or follow author to get release notifications in time.",- CompoundNouns::default(),+ test_linter(),);}}diff --git a/harper-core/src/linting/everyday.rs b/harper-core/src/linting/everyday.rsindex 47a627768..34bb229d6 100644--- a/harper-core/src/linting/everyday.rs+++ b/harper-core/src/linting/everyday.rs@@ -190,23 +190,26 @@ impl ExprLinter for Everyday {#[cfg(test)]mod tests {use super::Everyday;+ use crate::linting::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};+ create_test_pool!(Everyday, Everyday, Everyday::default());+#[test]fn dont_flag_lone_adjective() {- assert_lint_count("everyday", Everyday::default(), 0);+ assert_lint_count("everyday", test_linter(), 0);}#[test]fn dont_flag_lone_adverb() {- assert_lint_count("every day", Everyday::default(), 0);+ assert_lint_count("every day", test_linter(), 0);}#[test]fn correct_adjective_at_end_of_chunk() {assert_suggestion_result("This is something I do everyday.",- Everyday::default(),+ test_linter(),"This is something I do every day.",);}@@ -215,7 +218,7 @@ mod tests {fn correct_adverb_after_article_before_noun() {assert_suggestion_result("It's nothing special, just an every day thing.",- Everyday::default(),+ test_linter(),"It's nothing special, just an everyday thing.",);}@@ -225,7 +228,7 @@ mod tests {fn correct_adjective_without_following_noun() {assert_suggestion_result("Some git commands used everyday",- Everyday::default(),+ test_linter(),"Some git commands used every day",);}@@ -234,21 +237,21 @@ mod tests {fn dont_flag_everyday_adjective_before_dev() {assert_lint_count("At everyday dev, engineering isn't just a job - it's our passion.",- Everyday::default(),+ test_linter(),0,);}#[test]fn dont_flag_everyday_adjective_before_present_participle() {- assert_lint_count("Everyday coding projects.", Everyday::default(), 0);+ assert_lint_count("Everyday coding projects.", test_linter(), 0);}#[test]fn dont_flag_everyday_adjective_before_plural_noun() {assert_lint_count("Exploring Everyday Things with R and Ruby",- Everyday::default(),+ test_linter(),0,);}@@ -257,7 +260,7 @@ mod tests {fn correct_everyday_at_end_of_sentence_after_past_verb() {assert_suggestion_result("Trying to write about what I learned everyday.",- Everyday::default(),+ test_linter(),"Trying to write about what I learned every day.",);}@@ -266,26 +269,26 @@ mod tests {fn dont_flag_every_day_at_start_of_sentence_before_comma() {assert_lint_count("Every day, a new concept or improvement will be shared",- Everyday::default(),+ test_linter(),0,);}#[test]fn dont_flag_every_day_at_start_of_sentence_before_copula() {- assert_lint_count("Every day is worth remembering...", Everyday::default(), 0);+ assert_lint_count("Every day is worth remembering...", test_linter(), 0);}#[test]fn dont_flag_every_day_at_end_of_sentence_after_noun() {- assert_lint_count("You learn new stuff every day.", Everyday::default(), 0);+ assert_lint_count("You learn new stuff every day.", test_linter(), 0);}#[test]fn dont_flag_every_day_after_noun_before_conjunction() {assert_lint_count("Pick a different test item every day and confirm it is present.",- Everyday::default(),+ test_linter(),0,);}@@ -295,25 +298,21 @@ mod tests {fn correct_every_day_after_article() {assert_suggestion_result("The Every Day Calendar with Dark Mode",- Everyday::default(),+ test_linter(),"The Everyday Calendar with Dark Mode",);}#[test]fn dont_flag_everyday_before_unknown_word() {- assert_lint_count(- "It's just a normal everyday splorg.",- Everyday::default(),- 0,- );+ assert_lint_count("It's just a normal everyday splorg.", test_linter(), 0);}#[test]fn dont_flag_every_day_at_end_of_chunk_after_adverb() {assert_lint_count("I use the same amount of energy basically every day",- Everyday::default(),+ test_linter(),0,);}@@ -322,7 +321,7 @@ mod tests {fn dont_flag_every_day_after_verb_before_if() {assert_lint_count("This would happen every day if left alone.",- Everyday::default(),+ test_linter(),0,);}@@ -331,25 +330,21 @@ mod tests {fn dont_flag_every_day_after_noun_before_preposition() {assert_lint_count("An animal can do training and inference every day of its existence until the day of its death.",- Everyday::default(),+ test_linter(),0,);}#[test]fn dont_flag_every_day_after_time() {- assert_lint_count(- "Can I take a picture at 12:00 every day?",- Everyday::default(),- 0,- );+ assert_lint_count("Can I take a picture at 12:00 every day?", test_linter(), 0);}#[test]fn dont_flag_every_day_at_start_of_chunk_before_np() {assert_lint_count("Every day the application crashes several times on macOS Sequoia version 15.3",- Everyday::default(),+ test_linter(),0,);}@@ -358,7 +353,7 @@ mod tests {fn fix_everyday_and_every_day_used_wrongly() {assert_suggestion_result("Each and everyday you ought to strive to learn something that is not an every day thing.",- Everyday::default(),+ test_linter(),"Each and every day you ought to strive to learn something that is not an everyday thing.",);}@@ -367,7 +362,7 @@ mod tests {fn fix_reddit_why_does_everyday() {assert_suggestion_result("Why does everyday feel the same?",- Everyday::default(),+ test_linter(),"Why does every day feel the same?",);}@@ -376,7 +371,7 @@ mod tests {fn fix_reddit_everyday_is_going_to() {assert_suggestion_result("... everyday is going to be a good day that's just the way it is!",- Everyday::default(),+ test_linter(),"... every day is going to be a good day that's just the way it is!",);}@@ -385,7 +380,7 @@ mod tests {fn fix_reddit_draw_everyday() {assert_suggestion_result("Do you actually improve if you draw everyday?",- Everyday::default(),+ test_linter(),"Do you actually improve if you draw every day?",);}@@ -394,7 +389,7 @@ mod tests {fn fix_reddit_two_bad_out_of_three() {assert_suggestion_result("Yes you can jog everyday, not a personal best every day, but a steady pace run everyday.",- Everyday::default(),+ test_linter(),"Yes you can jog every day, not a personal best every day, but a steady pace run every day.",);}@@ -403,7 +398,7 @@ mod tests {fn fix_reddit_every_day_routine() {assert_suggestion_result("Habit stacking - stacking the small skill with something that's already worked into my every day routine.",- Everyday::default(),+ test_linter(),"Habit stacking - stacking the small skill with something that's already worked into my everyday routine.",);}@@ -412,7 +407,7 @@ mod tests {fn fix_stackoverflow_every_day_things() {assert_suggestion_result("However, the message goes far beyond every day things.",- Everyday::default(),+ test_linter(),"However, the message goes far beyond everyday things.",);}@@ -421,7 +416,7 @@ mod tests {fn fix_reddit_everyday_is_same() {assert_suggestion_result("Everyday is exactly the same",- Everyday::default(),+ test_linter(),"Every day is exactly the same",);}@@ -431,7 +426,7 @@ mod tests {fn fix_medium_little_bit_everyday() {assert_suggestion_result("Does Learning A Little Bit Everyday Actually Work?",- Everyday::default(),+ test_linter(),"Does Learning A Little Bit Every Day Actually Work?",);}@@ -440,7 +435,7 @@ mod tests {fn fix_stackexchange_use_everyday() {assert_suggestion_result("We use this everyday without noticing, but we hate it when ...",- Everyday::default(),+ test_linter(),"We use this every day without noticing, but we hate it when ...",);}@@ -449,7 +444,7 @@ mod tests {fn fix_github_what_i_learned_everyday() {assert_suggestion_result("Trying to write about what I learned everyday.",- Everyday::default(),+ test_linter(),"Trying to write about what I learned every day.",);}@@ -458,7 +453,7 @@ mod tests {fn fix_medium_one_bad_out_of_three() {assert_suggestion_result("Even inside a routine, everyday we adapt to changes and challenges ... We are not the same person every day, but every day we are ourselves…",- Everyday::default(),+ test_linter(),"Even inside a routine, every day we adapt to changes and challenges ... We are not the same person every day, but every day we are ourselves…",);}@@ -467,7 +462,7 @@ mod tests {fn fix_medium_doing_something_everyday() {assert_suggestion_result("There was nothing wrong with my braincells processing the concepts of doing something everyday and ...",- Everyday::default(),+ test_linter(),"There was nothing wrong with my braincells processing the concepts of doing something every day and ...",);}@@ -476,13 +471,13 @@ mod tests {fn fix_medium_all_caps() {assert_suggestion_result("MEET SOMEONE NEW EVERYDAY.",- Everyday::default(),+ test_linter(),"MEET SOMEONE NEW EVERY DAY.",);}#[test]fn dont_flag_every_day_singular_noun_2020() {- assert_no_lints("50 requests per day, every day free.", Everyday::default());+ assert_no_lints("50 requests per day, every day free.", test_linter());}}diff --git a/harper-core/src/linting/how_to.rs b/harper-core/src/linting/how_to.rsindex 082929136..ef326d0be 100644--- a/harper-core/src/linting/how_to.rs+++ b/harper-core/src/linting/how_to.rs@@ -109,27 +109,30 @@ impl ExprLinter for HowTo {#[cfg(test)]mod tests {use super::HowTo;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};+ create_test_pool!(HowTo, HowTo, HowTo::default());+#[test]fn flags_missing_to() {assert_suggestion_result("Here's how clone the repository.",- HowTo::default(),+ test_linter(),"Here's how to clone the repository.",);}#[test]fn ignores_correct_phrase() {- assert_lint_count("Here's how to clone the repository.", HowTo::default(), 0);+ assert_lint_count("Here's how to clone the repository.", test_linter(), 0);}#[test]fn flags_other_verbs() {assert_suggestion_result("Learn how install Rust.",- HowTo::default(),+ test_linter(),"Learn how to install Rust.",);}@@ -138,7 +141,7 @@ mod tests {fn ros_package_install() {assert_suggestion_result("Can someone explain how install this ROS package on Humble?",- HowTo::default(),+ test_linter(),"Can someone explain how to install this ROS package on Humble?",);}@@ -147,7 +150,7 @@ mod tests {fn extract_and_install_app() {assert_suggestion_result("Here’s a quick guide on how install an app you’ve extracted from a tarball.",- HowTo::default(),+ test_linter(),"Here’s a quick guide on how to install an app you’ve extracted from a tarball.",);}@@ -156,7 +159,7 @@ mod tests {fn dll_files() {assert_suggestion_result("This video shows how fix missing DLL files on Windows.",- HowTo::default(),+ test_linter(),"This video shows how to fix missing DLL files on Windows.",);}@@ -165,7 +168,7 @@ mod tests {fn dofus_on_ubuntu() {assert_suggestion_result("Full tutorial on how install Dofus under Ubuntu.",- HowTo::default(),+ test_linter(),"Full tutorial on how to install Dofus under Ubuntu.",);}@@ -174,7 +177,7 @@ mod tests {fn tar_gz_install() {assert_suggestion_result("Find out how install software shipped as a .tar.gz archive.",- HowTo::default(),+ test_linter(),"Find out how to install software shipped as a .tar.gz archive.",);}@@ -183,7 +186,7 @@ mod tests {fn thrift_libraries() {assert_suggestion_result("Anyone know how install the Thrift libraries from source?",- HowTo::default(),+ test_linter(),"Anyone know how to install the Thrift libraries from source?",);}@@ -192,7 +195,7 @@ mod tests {fn windows_adk() {assert_suggestion_result("Lost the Windows ADK again—remind me how install it?",- HowTo::default(),+ test_linter(),"Lost the Windows ADK again—remind me how to install it?",);}@@ -201,7 +204,7 @@ mod tests {fn accounting_errors() {assert_suggestion_result("Eight common accounting errors and how fix them.",- HowTo::default(),+ test_linter(),"Eight common accounting errors and how to fix them.",);}@@ -210,7 +213,7 @@ mod tests {fn sentence_fragments() {assert_suggestion_result("Here’s what sentence fragments are and how fix them.",- HowTo::default(),+ test_linter(),"Here’s what sentence fragments are and how to fix them.",);}@@ -219,7 +222,7 @@ mod tests {fn zipper_slider() {assert_suggestion_result("Quick demo on how fix a broken zipper slider.",- HowTo::default(),+ test_linter(),"Quick demo on how to fix a broken zipper slider.",);}@@ -228,91 +231,79 @@ mod tests {fn door_lock() {assert_suggestion_result("Tips on how fix a door that won’t lock.",- HowTo::default(),+ test_linter(),"Tips on how to fix a door that won’t lock.",);}#[test]fn already_correct_install() {- assert_lint_count(- "See how to install the package with apt.",- HowTo::default(),- 0,- );+ assert_lint_count("See how to install the package with apt.", test_linter(), 0);}#[test]fn already_correct_fix() {assert_lint_count("He showed me how to fix the zipper in ten minutes.",- HowTo::default(),+ test_linter(),0,);}#[test]fn how_are_you() {- assert_lint_count("How are you?", HowTo::default(), 0);+ assert_lint_count("How are you?", test_linter(), 0);}#[test]fn how_calm_you_are() {- assert_lint_count("I like how calm you are.", HowTo::default(), 0);+ assert_lint_count("I like how calm you are.", test_linter(), 0);}#[test]fn how_will_you_make_up() {- assert_lint_count(- "How will you make up for your mistakes?",- HowTo::default(),- 0,- );+ assert_lint_count("How will you make up for your mistakes?", test_linter(), 0);}#[test]fn storytelling_clause() {assert_lint_count("I will tell about how leaving my husband led to my dog winning a Nobel Prize.",- HowTo::default(),+ test_linter(),0,);}#[test]fn dont_flag_how_did_you() {- assert_lint_count("How did you get to school every day?", HowTo::default(), 0);+ assert_lint_count("How did you get to school every day?", test_linter(), 0);}#[test]fn dont_flag_how_come() {- assert_lint_count(- "How come this has to be a special case?",- HowTo::default(),- 0,- );+ assert_lint_count("How come this has to be a special case?", test_linter(), 0);}#[test]fn allows_how_has() {- assert_lint_count("How Has This Been Tested?", HowTo::default(), 0);+ assert_lint_count("How Has This Been Tested?", test_linter(), 0);}#[test]fn issue_1492() {assert_no_lints("I hope to provide some insight into correct HTML formatting, in addition to how authors can avoid these issues.",- HowTo::default(),+ test_linter(),);- assert_no_lints("But how does something like this...", HowTo::default());+ assert_no_lints("But how does something like this...", test_linter());}#[test]fn allow_issue_1298() {assert_no_lints("The story of how and why things came to this point.",- HowTo::default(),+ test_linter(),);}@@ -320,7 +311,7 @@ mod tests {fn dont_flag_false_positive_pr_1846() {assert_no_lints("About how Microsoft, Google, and others are training people in Rust.",- HowTo::default(),+ test_linter(),)}@@ -328,20 +319,20 @@ mod tests {fn dont_flag_false_positives_1492_how_indexes() {assert_no_lints("controls how indexes will be added to unwrapped keys of flat array-like objects",- HowTo::default(),+ test_linter(),);}#[test]fn dont_flag_how_proper_noun_handles() {- assert_no_lints("rewrites how Wine handles file locking", HowTo::default());+ assert_no_lints("rewrites how Wine handles file locking", test_linter());}#[test]fn dont_flag_how_work_is_structured() {assert_no_lints("They need to rethink how work is structured and valued.",- HowTo::default(),+ test_linter(),);}@@ -349,7 +340,7 @@ mod tests {fn dont_flag_how_form_submissions_are_delivered() {assert_no_lints("The Mail tab dictates how form submissions are delivered to you.",- HowTo::default(),+ test_linter(),);}@@ -357,7 +348,7 @@ mod tests {fn dont_flag_how_access_to_food_shaped_revolutions() {assert_no_lints("We analyze how access to food shaped political ideologies.",- HowTo::default(),+ test_linter(),);}@@ -365,11 +356,11 @@ mod tests {fn issue_2124() {assert_no_lints("I like how discord shows Spotify status on your profile.",- HowTo::default(),+ test_linter(),);assert_no_lints("To be determined based on how error handling is done in new paradigm.",- HowTo::default(),+ test_linter(),);}}diff --git a/harper-core/src/linting/its_contraction/mod.rs b/harper-core/src/linting/its_contraction/mod.rsindex 64780bea7..a8ecff46e 100644--- a/harper-core/src/linting/its_contraction/mod.rs+++ b/harper-core/src/linting/its_contraction/mod.rs@@ -14,13 +14,16 @@ merge_linters!(#[cfg(test)]mod tests {use super::ItsContraction;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};+ create_test_pool!(ItsContraction, ItsContraction, ItsContraction::default());+#[test]fn fix_had() {assert_suggestion_result("Its had an enormous effect.",- ItsContraction::default(),+ test_linter(),"It's had an enormous effect.",);}@@ -29,7 +32,7 @@ mod tests {fn fix_been() {assert_suggestion_result("Its been months since we spoke.",- ItsContraction::default(),+ test_linter(),"It's been months since we spoke.",);}@@ -38,7 +41,7 @@ mod tests {fn fix_got() {assert_suggestion_result("I think its got nothing to do with us.",- ItsContraction::default(),+ test_linter(),"I think it's got nothing to do with us.",);}@@ -47,25 +50,21 @@ mod tests {fn fixes_its_common() {assert_suggestion_result("Its common for users to get frustrated.",- ItsContraction::default(),+ test_linter(),"It's common for users to get frustrated.",);}#[test]fn ignore_correct_contraction() {- assert_lint_count(- "It's been a long year for everyone.",- ItsContraction::default(),- 0,- );+ assert_lint_count("It's been a long year for everyone.", test_linter(), 0);}#[test]fn ignore_possessive() {assert_lint_count("The company revised its policies last week.",- ItsContraction::default(),+ test_linter(),0,);}@@ -74,25 +73,21 @@ mod tests {fn ignore_coroutine() {assert_lint_count("Launch each task within its own child coroutine.",- ItsContraction::default(),+ test_linter(),0,);}#[test]fn issue_381() {- assert_suggestion_result(- "Its a nice day.",- ItsContraction::default(),- "It's a nice day.",- );+ assert_suggestion_result("Its a nice day.", test_linter(), "It's a nice day.");}#[test]fn ignore_nominal_progressive() {assert_lint_count("The class preserves its existing properties.",- ItsContraction::default(),+ test_linter(),0,);}@@ -102,7 +97,7 @@ mod tests {fn ignore_nominal_perfect() {assert_lint_count("The robot followed its predetermined route.",- ItsContraction::default(),+ test_linter(),0,);}@@ -111,7 +106,7 @@ mod tests {fn ignore_nominal_long() {assert_lint_count("I think of its exploding marvelous spectacular output.",- ItsContraction::default(),+ test_linter(),0,);}@@ -120,7 +115,7 @@ mod tests {fn corrects_because() {assert_suggestion_result("Its because they don't want to.",- ItsContraction::default(),+ test_linter(),"It's because they don't want to.",);}@@ -129,7 +124,7 @@ mod tests {fn corrects_its_hard() {assert_suggestion_result("Its hard to believe that.",- ItsContraction::default(),+ test_linter(),"It's hard to believe that.",);}@@ -138,7 +133,7 @@ mod tests {fn corrects_its_easy() {assert_suggestion_result("Its easy if you try.",- ItsContraction::default(),+ test_linter(),"It's easy if you try.",);}@@ -147,7 +142,7 @@ mod tests {fn corrects_its_a_picnic() {assert_suggestion_result("Its a beautiful day for a picnic",- ItsContraction::default(),+ test_linter(),"It's a beautiful day for a picnic",);}@@ -156,7 +151,7 @@ mod tests {fn corrects_its_my() {assert_suggestion_result("Its my favorite song.",- ItsContraction::default(),+ test_linter(),"It's my favorite song.",);}@@ -165,80 +160,63 @@ mod tests {fn allows_its_new() {assert_no_lints("The company announced its new product line. ",- ItsContraction::default(),+ test_linter(),);}#[test]fn allows_its_own_charm() {- assert_no_lints("The house has its own charm. ", ItsContraction::default());+ assert_no_lints("The house has its own charm. ", test_linter());}#[test]fn allows_its_victory() {- assert_no_lints(- "The team celebrated its victory. ",- ItsContraction::default(),- );+ assert_no_lints("The team celebrated its victory. ", test_linter());}#[test]fn allows_its_history() {- assert_no_lints(- "The country is proud of its history. ",- ItsContraction::default(),- );+ assert_no_lints("The country is proud of its history. ", test_linter());}#[test]fn allows_its_secrets() {- assert_no_lints(- "The book contains its own secrets. ",- ItsContraction::default(),- );+ assert_no_lints("The book contains its own secrets. ", test_linter());}#[test]fn corrects_think_google() {assert_suggestion_result("I think its Google, not Microsoft.",- ItsContraction::default(),+ test_linter(),"I think it's Google, not Microsoft.",);}#[test]fn corrects_hope_katie() {- assert_suggestion_result(- "I hope its Katie.",- ItsContraction::default(),- "I hope it's Katie.",- );+ assert_suggestion_result("I hope its Katie.", test_linter(), "I hope it's Katie.");}#[test]fn corrects_guess_date() {assert_suggestion_result("I guess its March 6.",- ItsContraction::default(),+ test_linter(),"I guess it's March 6.",);}#[test]fn corrects_assume_john() {- assert_suggestion_result(- "We assume its John.",- ItsContraction::default(),- "We assume it's John.",- );+ assert_suggestion_result("We assume its John.", test_linter(), "We assume it's John.");}#[test]fn corrects_doubt_tesla() {assert_suggestion_result("They doubt its Tesla this year.",- ItsContraction::default(),+ test_linter(),"They doubt it's Tesla this year.",);}@@ -247,48 +225,36 @@ mod tests {fn handles_two_word_name() {assert_suggestion_result("She thinks its New York.",- ItsContraction::default(),+ test_linter(),"She thinks it's New York.",);}#[test]fn ignores_existing_contraction() {- assert_lint_count("I think it's Google.", ItsContraction::default(), 0);+ assert_lint_count("I think it's Google.", test_linter(), 0);}#[test]fn ignores_possessive_noun_after_name() {- assert_lint_count(- "I think its Google product launch.",- ItsContraction::default(),- 0,- );+ assert_lint_count("I think its Google product launch.", test_linter(), 0);}#[test]fn ignores_without_opinion_verb() {- assert_lint_count(- "Its Google Pixel lineup is impressive.",- ItsContraction::default(),- 0,- );+ assert_lint_count("Its Google Pixel lineup is impressive.", test_linter(), 0);}#[test]fn ignores_common_noun_target() {- assert_lint_count(- "We hope its accuracy improves.",- ItsContraction::default(),- 0,- );+ assert_lint_count("We hope its accuracy improves.", test_linter(), 0);}#[test]fn issue_2547() {assert_no_lints("using the foo feature and its associated parameter",- ItsContraction::default(),+ test_linter(),);}@@ -296,7 +262,7 @@ mod tests {fn ignore_past_participle_noun_phrase() {assert_no_lints("using the foo feature and its abetted parameter",- ItsContraction::default(),+ test_linter(),);}@@ -304,7 +270,7 @@ mod tests {fn corrects_predicative_called() {assert_suggestion_result("Its called recursion.",- ItsContraction::default(),+ test_linter(),"It's called recursion.",);}@@ -313,24 +279,21 @@ mod tests {fn corrects_predicative_named() {assert_suggestion_result("Its named Manhattan.",- ItsContraction::default(),+ test_linter(),"It's named Manhattan.",);}#[test]fn allows_possessive_generated_code() {- assert_no_lints(- "The compiler emits its generated code.",- ItsContraction::default(),- );+ assert_no_lints("The compiler emits its generated code.", test_linter());}#[test]fn corrects_its_anybody() {assert_suggestion_result("Its anybody who volunteers should speak up.",- ItsContraction::default(),+ test_linter(),"It's anybody who volunteers should speak up.",);}@@ -339,7 +302,7 @@ mod tests {fn corrects_its_anyone() {assert_suggestion_result("Its anyone you ping will be looped in automatically.",- ItsContraction::default(),+ test_linter(),"It's anyone you ping will be looped in automatically.",);}@@ -348,7 +311,7 @@ mod tests {fn corrects_its_everyone() {assert_suggestion_result("Its everyone on the thread noticed the spike.",- ItsContraction::default(),+ test_linter(),"It's everyone on the thread noticed the spike.",);}@@ -357,7 +320,7 @@ mod tests {fn corrects_its_everything() {assert_suggestion_result("Its everything we collect ends up in the archive.",- ItsContraction::default(),+ test_linter(),"It's everything we collect ends up in the archive.",);}@@ -366,7 +329,7 @@ mod tests {fn corrects_its_somebody() {assert_suggestion_result("Its somebody on call right now.",- ItsContraction::default(),+ test_linter(),"It's somebody on call right now.",);}@@ -375,7 +338,7 @@ mod tests {fn corrects_its_somewhere() {assert_suggestion_result("Its somewhere safe to stash the nightly dump.",- ItsContraction::default(),+ test_linter(),"It's somewhere safe to stash the nightly dump.",);}@@ -384,7 +347,7 @@ mod tests {fn corrects_its_nobody() {assert_suggestion_result("Its nobody left who can approve this.",- ItsContraction::default(),+ test_linter(),"It's nobody left who can approve this.",);}@@ -393,7 +356,7 @@ mod tests {fn corrects_its_anywhere() {assert_suggestion_result("Its anywhere the monitors blink red.",- ItsContraction::default(),+ test_linter(),"It's anywhere the monitors blink red.",);}@@ -402,7 +365,7 @@ mod tests {fn corrects_its_anything() {assert_suggestion_result("Its anything worth keeping should be archived.",- ItsContraction::default(),+ test_linter(),"It's anything worth keeping should be archived.",);}@@ -411,48 +374,39 @@ mod tests {fn corrects_its_something() {assert_suggestion_result("Its something that keeps restarting the job.",- ItsContraction::default(),+ test_linter(),"It's something that keeps restarting the job.",);}#[test]fn allows_its_tail() {- assert_no_lints(- "Its tail twitches every time I call it.",- ItsContraction::default(),- );+ assert_no_lints("Its tail twitches every time I call it.", test_linter());}#[test]fn allows_its_release_pipeline() {assert_no_lints("Its release pipeline is stable in production.",- ItsContraction::default(),+ test_linter(),);}#[test]fn allows_its_nodes() {- assert_no_lints(- "The cluster updates its nodes nightly.",- ItsContraction::default(),- );+ assert_no_lints("The cluster updates its nodes nightly.", test_linter());}#[test]fn allows_its_cover_page() {- assert_no_lints(- "Its cover page mentions all contributors.",- ItsContraction::default(),- );+ assert_no_lints("Its cover page mentions all contributors.", test_linter());}#[test]fn allows_its_not_anybody() {assert_no_lints("Its not anybody to blame despite the outage.",- ItsContraction::default(),+ test_linter(),);}@@ -460,7 +414,7 @@ mod tests {fn allows_its_never_anywhere() {assert_no_lints("Its never anywhere near the ideal timing we hoped for.",- ItsContraction::default(),+ test_linter(),);}@@ -468,7 +422,7 @@ mod tests {fn allows_at_its_highest() {assert_no_lints("Curiosity about Gatsby was at its highest that night.",- ItsContraction::default(),+ test_linter(),);}@@ -476,7 +430,7 @@ mod tests {fn allows_its_pull_is() {assert_no_lints("The Earth is huge, so its pull is super strong.",- ItsContraction::default(),+ test_linter(),);}@@ -484,7 +438,7 @@ mod tests {fn allows_its_unforeseen_consequences() {assert_no_lints("The experiment continued despite its unforeseen consequences.",- ItsContraction::default(),+ test_linter(),);}@@ -492,7 +446,7 @@ mod tests {fn allows_its_potential_to_benefit() {assert_no_lints("The proposal emphasized its potential to benefit local businesses.",- ItsContraction::default(),+ test_linter(),);}@@ -500,15 +454,12 @@ mod tests {fn allows_its_cover_was() {assert_no_lints("Its cover was intricately engraved with floral patterns.",- ItsContraction::default(),+ test_linter(),);}#[test]fn allows_its_starting_level() {- assert_no_lints(- "Reduce the tracker to its starting level.",- ItsContraction::default(),- );+ assert_no_lints("Reduce the tracker to its starting level.", test_linter());}}diff --git a/harper-core/src/linting/its_possessive.rs b/harper-core/src/linting/its_possessive.rsindex 99bbe23cb..8b590f553 100644--- a/harper-core/src/linting/its_possessive.rs+++ b/harper-core/src/linting/its_possessive.rs@@ -152,6 +152,9 @@ impl ExprLinter for ItsPossessive {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(ItsPossessive, ItsPossessive, ItsPossessive::default());use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};use super::ItsPossessive;@@ -160,7 +163,7 @@ mod tests {fn corrects_its_various() {assert_suggestion_result("I like it's various colors.",- ItsPossessive::default(),+ test_linter(),"I like its various colors.",);}@@ -169,43 +172,35 @@ mod tests {fn fixes_inspiration() {assert_suggestion_result("I would just put `Orthography` and it's various function implementations in their own `orthography.rs` file.",- ItsPossessive::default(),+ test_linter(),"I would just put `Orthography` and its various function implementations in their own `orthography.rs` file.",);}#[test]fn engine_lost_its_compression() {- assert_lint_count(- "The engine lost it's compression.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("The engine lost it's compression.", test_linter(), 1);}#[test]fn admired_sculpture_for_its_intricacy() {assert_suggestion_result("I admired the sculpture for it's intricacy.",- ItsPossessive::default(),+ test_linter(),"I admired the sculpture for its intricacy.",);}#[test]fn paris_is_known_for_its_architecture() {- assert_lint_count(- "Paris is known for it's architecture.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("Paris is known for it's architecture.", test_linter(), 1);}#[test]fn plain_sentence_with_apostrophe_s() {assert_suggestion_result("It's benefits are numerous.",- ItsPossessive::default(),+ test_linter(),"Its benefits are numerous.",);}@@ -214,134 +209,95 @@ mod tests {fn fixes_its_ancestor() {assert_suggestion_result("It's ancestor is still around.",- ItsPossessive::default(),+ test_linter(),"Its ancestor is still around.",);}#[test]fn device_reached_its_100th_cycle() {- assert_lint_count(- "The device reached it's 100th cycle.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("The device reached it's 100th cycle.", test_linter(), 1);}#[test]fn oddly_its_wheels_misaligned() {- assert_lint_count(- "Oddly, it's wheels were misaligned.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("Oddly, it's wheels were misaligned.", test_linter(), 1);}#[test]fn leaking_oil_constant_issue() {- assert_lint_count("It's leaking oil constantly.", ItsPossessive::default(), 0);+ assert_lint_count("It's leaking oil constantly.", test_linter(), 0);}#[test]fn fiftyth_anniversary() {assert_lint_count("The company celebrated it's 50th anniversary.",- ItsPossessive::default(),+ test_linter(),1,);}#[test]fn second_attempt() {- assert_lint_count("He failed it's 2nd attempt.", ItsPossessive::default(), 1);+ assert_lint_count("He failed it's 2nd attempt.", test_linter(), 1);}#[test]fn third_iteration() {- assert_lint_count(- "The program finished it's 3rd iteration.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("The program finished it's 3rd iteration.", test_linter(), 1);}#[test]fn tenth_milestone() {- assert_lint_count(- "They reached it's 10th milestone.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("They reached it's 10th milestone.", test_linter(), 1);}#[test]fn seventh_chapter() {- assert_lint_count(- "The novel lost it's 7th chapter.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("The novel lost it's 7th chapter.", test_linter(), 1);}#[test]fn fifth_version() {- assert_lint_count(- "Software updated to it's 5th version.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("Software updated to it's 5th version.", test_linter(), 1);}#[test]fn eighth_floor() {- assert_lint_count(- "Elevator stopped at it's 8th floor.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("Elevator stopped at it's 8th floor.", test_linter(), 1);}#[test]fn twelfth_episode() {- assert_lint_count(- "Series ended it's 12th episode.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("Series ended it's 12th episode.", test_linter(), 1);}#[test]fn fourth_draft() {- assert_lint_count("He completed it's 4th draft.", ItsPossessive::default(), 1);+ assert_lint_count("He completed it's 4th draft.", test_linter(), 1);}#[test]fn ninth_revision() {- assert_lint_count(- "The report saved it's 9th revision.",- ItsPossessive::default(),- 1,- );+ assert_lint_count("The report saved it's 9th revision.", test_linter(), 1);}#[test]fn allows_hard_to_tell() {- assert_no_lints("It's hard to tell from here.", ItsPossessive::default());+ assert_no_lints("It's hard to tell from here.", test_linter());}#[test]fn allows_illegible() {- assert_no_lints(- "When you write in cursive, its illegible",- ItsPossessive::default(),- );+ assert_no_lints("When you write in cursive, its illegible", test_linter());}#[test]fn allows_good_practice() {assert_no_lints("it's good practice to review the general settings",- ItsPossessive::default(),+ test_linter(),);}@@ -349,7 +305,7 @@ mod tests {fn allows_understandable() {assert_no_lints("It's understandable that you'd feel the weight of responsibility.",- ItsPossessive::default(),+ test_linter(),);}@@ -357,7 +313,7 @@ mod tests {fn allows_insincere() {assert_no_lints("But feel free to omit it if you feel it's insincere.",- ItsPossessive::default(),+ test_linter(),);}@@ -365,7 +321,7 @@ mod tests {fn allows_its_possible() {assert_no_lints("It's possible that a record was improperly handled. ",- ItsPossessive::default(),+ test_linter(),);}@@ -373,23 +329,20 @@ mod tests {fn allows_many_times_harder() {assert_no_lints("It's many times harder to do this than that.",- ItsPossessive::default(),+ test_linter(),);}#[test]fn allow_issue_1658() {- assert_no_lints(- "It's kind of a nuisance, but it will work.",- ItsPossessive::default(),- );+ assert_no_lints("It's kind of a nuisance, but it will work.", test_linter());}#[test]fn allow_issue_2001() {assert_no_lints("It's worth highlighting that while using a fork instead of a spoon is easy, it sometimes isn't.",- ItsPossessive::default(),+ test_linter(),);}@@ -397,7 +350,7 @@ mod tests {fn dont_flag_issue_1722_its_whats_accessible() {assert_no_lints("The base execution context is the global execution context: it's what's accessible everywhere in your code.",- ItsPossessive::default(),+ test_linter(),);}@@ -405,25 +358,25 @@ mod tests {fn dont_flag_issue_1722_its_early_and() {assert_no_lints("it's early and there's plenty of room for novel and potentially",- ItsPossessive::default(),+ test_linter(),);}#[test]fn dont_flag_issue_1722_its_big_enough() {- assert_no_lints("It's big enough.", ItsPossessive::default());+ assert_no_lints("It's big enough.", test_linter());}#[test]fn allows_its_awesome() {- assert_no_lints("It's awesome.", ItsPossessive::default());+ assert_no_lints("It's awesome.", test_linter());}#[test]fn flags_all_its_possessive_in_list() {assert_lint_count("Understand it's code, it's values, and it's purpose.",- ItsPossessive::default(),+ test_linter(),3,);}@@ -432,7 +385,7 @@ mod tests {fn fixes_all_its_possessive_in_list() {assert_suggestion_result("Understand it's code, it's values, and it's purpose.",- ItsPossessive::default(),+ test_linter(),"Understand its code, its values, and its purpose.",);}diff --git a/harper-core/src/linting/lint_group/mod.rs b/harper-core/src/linting/lint_group/mod.rsindex a32050792..31c781578 100644--- a/harper-core/src/linting/lint_group/mod.rs+++ b/harper-core/src/linting/lint_group/mod.rs@@ -319,7 +319,7 @@ use crate::{{ExprLinter, HtmlDescriptionLinter, Lint, Linter},},spell::Dictionary,- {Dialect, Document, Lrc, TokenStringExt},+ {Dialect, Document, Span, TokenStringExt},};pub use flat_config::FlatConfig;@@ -343,10 +343,8 @@ pub struct LintGroup {////// Since the expr linter results also depend on the config, we hash it and pass it as part/// of the key.- #[expect(clippy::complexity)]- chunk_expr_cache: LruCache<(u64, u64), Lrc<BTreeMap<String, Vec<Lint>>>>,- #[expect(clippy::complexity)]- sentence_expr_cache: LruCache<(u64, u64), Lrc<BTreeMap<String, Vec<Lint>>>>,+ chunk_expr_cache: LruCache<(u64, u64), BTreeMap<String, Vec<Lint>>>,+ sentence_expr_cache: LruCache<(u64, u64), BTreeMap<String, Vec<Lint>>>,hasher_builder: RandomState,clashing_linter_names: Option<Vec<String>>,}@@ -948,6 +946,20 @@ impl LintGroup {}}+ let mut insert_items_to_results =+ |items: &BTreeMap<String, Vec<Lint>>, chunk_span: Span<char>| {+ for (key, vec) in items.iter() {+ results+ .entry(key.to_owned())+ .or_default()+ .extend(vec.iter().cloned().map(|mut lint| {+ // Bring the spans back into document-space+ lint.span.push_by(chunk_span.start);+ lint+ }));+ }+ };+// Expr lintersfor chunk in document.iter_chunks() {let Some(chunk_span) = chunk.span() else {@@ -959,8 +971,8 @@ impl LintGroup {let char_hash = self.hasher_builder.hash_one(chunk_chars);let cache_key = (char_hash, config_hash);- let chunk_results = if let Some(hit) = self.chunk_expr_cache.get(&cache_key) {- hit.clone()+ if let Some(hit) = self.chunk_expr_cache.get(&cache_key) {+ insert_items_to_results(hit, chunk_span);} else {let mut pattern_lints = BTreeMap::new();@@ -976,21 +988,8 @@ impl LintGroup {}}- let pattern_lints = Lrc::new(pattern_lints);-self.chunk_expr_cache.put(cache_key, pattern_lints.clone());- pattern_lints- };-- for (key, vec) in chunk_results.iter() {- results- .entry(key.to_owned())- .or_default()- .extend(vec.iter().cloned().map(|mut lint| {- // Bring the spans back into document-space- lint.span.push_by(chunk_span.start);- lint- }));+ insert_items_to_results(&pattern_lints, chunk_span);}}@@ -1005,8 +1004,8 @@ impl LintGroup {let char_hash = self.hasher_builder.hash_one(sentence_chars);let cache_key = (char_hash, config_hash);- let sentence_results = if let Some(hit) = self.sentence_expr_cache.get(&cache_key) {- hit.clone()+ if let Some(hit) = self.sentence_expr_cache.get(&cache_key) {+ insert_items_to_results(hit, sentence_span);} else {let mut pattern_lints = BTreeMap::new();@@ -1022,22 +1021,9 @@ impl LintGroup {}}- let pattern_lints = Lrc::new(pattern_lints);-self.sentence_expr_cache.put(cache_key, pattern_lints.clone());- pattern_lints- };-- for (key, vec) in sentence_results.iter() {- results- .entry(key.to_owned())- .or_default()- .extend(vec.iter().cloned().map(|mut lint| {- // Bring the spans back into document-space- lint.span.push_by(sentence_span.start);- lint- }));+ insert_items_to_results(&pattern_lints, sentence_span);}}@@ -1068,54 +1054,57 @@ impl Linter for LintGroup {mod tests {use std::sync::Arc;- use super::{FlatConfig, LintGroup};+ use super::LintGroup;use crate::linting::LintKind;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_no_lints, assert_suggestion_result};use crate::spell::{FstDictionary, MutableDictionary};use crate::weir::WeirLinter;use crate::{Dialect, Document, linting::Linter};- fn test_group() -> LintGroup {- LintGroup::new_curated(Arc::new(MutableDictionary::curated()), Dialect::American)- }+ create_test_pool!(+ LintGroup,+ LintGroup,+ LintGroup::new_curated(FstDictionary::curated(), Dialect::American)+ );#[test]fn clean_interjection() {assert_no_lints("Although I only saw the need to interject once, I still saw it.",- test_group(),+ test_linter(),);}#[test]fn clean_consensus() {- assert_no_lints("But there is less consensus on this.", test_group());+ assert_no_lints("But there is less consensus on this.", test_linter());}#[test]fn ive_corrects_to_single_word() {assert_suggestion_result("ive never seen that before",- test_group(),+ test_linter(),"I've never seen that before",);}#[test]fn worthchecking_is_split() {- assert_suggestion_result("It is worthchecking", test_group(), "It is worth checking");+ assert_suggestion_result("It is worthchecking", test_linter(), "It is worth checking");}#[test]fn its_not_perfect_keeps_apostrophe() {- assert_no_lints("It's not perfect", test_group());+ assert_no_lints("It's not perfect", test_linter());}#[test]fn corrects_extention() {- let mut group = test_group();+ let group = test_linter();let document = Document::new_plain_english_curated("I love this extention!");- let organized = group.organized_lints(&document);+ let organized = group.run_with_inner(|l| l.organized_lints(&document));let spellcheck_lints = organized.get("SpellCheck")@@ -1137,7 +1126,7 @@ mod tests {#[test]fn ok_becomes_okay() {- assert_suggestion_result("This is ok.", test_group(), "This is okay.");+ assert_suggestion_result("This is ok.", test_linter(), "This is okay.");}#[test]@@ -1183,7 +1172,7 @@ mod tests {fn dont_flag_low_hanging_fruit_msg() {assert_no_lints("The standard form is low-hanging fruit with a hyphen and singular form.",- test_group(),+ test_linter(),);}@@ -1191,25 +1180,25 @@ mod tests {fn dont_flag_low_hanging_fruit_desc() {assert_no_lints("Corrects nonstandard variants of low-hanging fruit.",- test_group(),+ test_linter(),);}#[test]fn fix_stoped() {- assert_suggestion_result("He stoped to think.", test_group(), "He stopped to think.");+ assert_suggestion_result("He stoped to think.", test_linter(), "He stopped to think.");}#[test]fn allow_playthrough() {- assert_no_lints("I recently did a playthrough.", test_group());+ assert_no_lints("I recently did a playthrough.", test_linter());}#[test]fn fixes_politicans() {assert_suggestion_result("I guess politicans like to complain.",- test_group(),+ test_linter(),"I guess politicans like to complain.",);}@@ -1218,7 +1207,7 @@ mod tests {fn fixes_benefitting() {assert_suggestion_result("Who is really benefitting from it?",- test_group(),+ test_linter(),"Who is really benefiting from it?",);}@@ -1227,7 +1216,7 @@ mod tests {fn fixes_easir() {assert_suggestion_result("It makes it easir to select it.",- test_group(),+ test_linter(),"It makes it easier to select it.",);}@@ -1236,7 +1225,7 @@ mod tests {fn fixes_buget() {assert_suggestion_result("It was in their buget range.",- test_group(),+ test_linter(),"It was in their budget range.",);}@@ -1258,31 +1247,28 @@ mod tests {fn lint_descriptions_are_clean() {let lints_to_check = LintGroup::new_curated(FstDictionary::curated(), Dialect::American);- let enforcer_config = FlatConfig::new_curated();- let mut lints_to_enforce =- LintGroup::new_curated(FstDictionary::curated(), Dialect::American)- .with_lint_config(enforcer_config);-let name_description_pairs: Vec<_> = lints_to_check.all_descriptions().into_iter().map(|(n, d)| (n.to_string(), d.to_string())).collect();- for (lint_name, description) in name_description_pairs {- let doc = Document::new_markdown_default_curated(&description);- eprintln!("{lint_name}: {description}");+ name_description_pairs+ .iter()+ .for_each(|(lint_name, description)| {+ let doc = Document::new_markdown_default_curated(&description);+ eprintln!("{lint_name}: {description}");- let mut lints = lints_to_enforce.lint(&doc);+ let mut lints = test_linter().lint(&doc);- // Remove ones related to style- lints.retain(|l| l.lint_kind != LintKind::Style);+ // Remove ones related to style+ lints.retain(|l| l.lint_kind != LintKind::Style);- if !lints.is_empty() {- dbg!(lints);- panic!();- }- }+ if !lints.is_empty() {+ dbg!(lints);+ panic!();+ }+ });}#[test]diff --git a/harper-core/src/linting/missing_to.rs b/harper-core/src/linting/missing_to.rsindex a505d9e8d..a303ab6c9 100644--- a/harper-core/src/linting/missing_to.rs+++ b/harper-core/src/linting/missing_to.rs@@ -431,13 +431,16 @@ impl ExprLinter for MissingTo {#[cfg(test)]mod tests {use super::MissingTo;+ use crate::linting::create_test_pool;use crate::linting::tests::{assert_no_lints, assert_suggestion_result};+ create_test_pool!(MissingTo, MissingTo, MissingTo::default());+#[test]fn inserts_to_after_meant() {assert_suggestion_result("I meant call you last night.",- MissingTo::default(),+ test_linter(),"I meant to call you last night.",);}@@ -446,7 +449,7 @@ mod tests {fn inserts_to_after_wants() {assert_suggestion_result("She wants finish early.",- MissingTo::default(),+ test_linter(),"She wants to finish early.",);}@@ -455,7 +458,7 @@ mod tests {fn inserts_to_after_need() {assert_suggestion_result("We need talk about pricing.",- MissingTo::default(),+ test_linter(),"We need to talk about pricing.",);}@@ -464,7 +467,7 @@ mod tests {fn inserts_to_after_agreed() {assert_suggestion_result("They agreed meet at dawn.",- MissingTo::default(),+ test_linter(),"They agreed to meet at dawn.",);}@@ -473,7 +476,7 @@ mod tests {fn inserts_to_after_forgot() {assert_suggestion_result("He forgot send the file.",- MissingTo::default(),+ test_linter(),"He forgot to send the file.",);}@@ -482,7 +485,7 @@ mod tests {fn inserts_to_after_trying() {assert_suggestion_result("I'm trying get better at chess.",- MissingTo::default(),+ test_linter(),"I'm trying to get better at chess.",);}@@ -491,7 +494,7 @@ mod tests {fn inserts_to_after_refused() {assert_suggestion_result("She refused answer the question.",- MissingTo::default(),+ test_linter(),"She refused to answer the question.",);}@@ -500,7 +503,7 @@ mod tests {fn inserts_to_after_ready() {assert_suggestion_result("We're ready start the meeting.",- MissingTo::default(),+ test_linter(),"We're ready to start the meeting.",);}@@ -509,7 +512,7 @@ mod tests {fn inserts_to_after_eager() {assert_suggestion_result("I'm eager see the results.",- MissingTo::default(),+ test_linter(),"I'm eager to see the results.",);}@@ -518,7 +521,7 @@ mod tests {fn inserts_to_after_inclined() {assert_suggestion_result("I'm inclined believe you.",- MissingTo::default(),+ test_linter(),"I'm inclined to believe you.",);}@@ -527,26 +530,26 @@ mod tests {fn inserts_to_after_resolved() {assert_suggestion_result("She resolved solve the case.",- MissingTo::default(),+ test_linter(),"She resolved to solve the case.",);}#[test]fn no_lint_when_to_present() {- assert_no_lints("She wants to finish early.", MissingTo::default());+ assert_no_lints("She wants to finish early.", test_linter());}#[test]fn no_lint_with_noun_after_controller() {- assert_no_lints("They arranged a meeting at noon.", MissingTo::default());+ assert_no_lints("They arranged a meeting at noon.", test_linter());}#[test]fn no_lint_needs_follow_up_appointments() {assert_no_lints("Gus is recovering well, though he needs follow-up appointments.",- MissingTo::default(),+ test_linter(),);}@@ -554,7 +557,7 @@ mod tests {fn no_lint_delays_meant_decisions() {assert_no_lints("The delays meant decisions were often made on outdated information, hindering agility and potentially impacting return on investment.",- MissingTo::default(),+ test_linter(),);}@@ -562,7 +565,7 @@ mod tests {fn no_lint_reduced_relative_clause_after_participle() {assert_no_lints("The techniques learned would probably not change much with resolution so 480i would seem almost as usable for educational use as 8K video.",- MissingTo::default(),+ test_linter(),);}@@ -570,7 +573,7 @@ mod tests {fn no_lint_bouquet_of_roses() {assert_no_lints("I made a note to request a small bouquet of roses for his room, a simple gesture that I hoped would bring a moment of solace.",- MissingTo::default(),+ test_linter(),);}@@ -578,7 +581,7 @@ mod tests {fn no_lint_for_intended_word_phrase() {assert_no_lints("Detects incorrect usage of `peak` when the intended word is `pique`.",- MissingTo::default(),+ test_linter(),);}@@ -586,7 +589,7 @@ mod tests {fn no_lint_long_passage() {assert_no_lints("Before her was another long passage illuminated by lamps.",- MissingTo::default(),+ test_linter(),);}@@ -594,7 +597,7 @@ mod tests {fn no_lint_long_island_sound() {assert_no_lints("The sailboat drifted along Long Island Sound at sunrise.",- MissingTo::default(),+ test_linter(),);}@@ -602,7 +605,7 @@ mod tests {fn no_lint_learn_tag_probabilities() {assert_no_lints("These models learn tag probabilities from annotated corpora.",- MissingTo::default(),+ test_linter(),);}@@ -610,7 +613,7 @@ mod tests {fn no_lint_standard_feature_nominal_phrase() {assert_no_lints("This is a standard and expected feature for any e-commerce site selling visually-driven products.",- MissingTo::default(),+ test_linter(),);}@@ -618,119 +621,113 @@ mod tests {fn no_lint_mixing_bowl_nominal_phrase() {assert_no_lints("This is a 2-quart mixing bowl, ideal for everything from whipping cream to preparing cake batter.",- MissingTo::default(),+ test_linter(),);}#[test]fn no_lint_try_and_say() {- assert_no_lints(- "I'll try and say hello before I leave.",- MissingTo::default(),- );+ assert_no_lints("I'll try and say hello before I leave.", test_linter());}#[test]fn no_lint_failed_edit_attempts() {- assert_no_lints("failed edit attempts", MissingTo::default());+ assert_no_lints("failed edit attempts", test_linter());}#[test]fn no_lint_ready_work() {- assert_no_lints("ready work", MissingTo::default());+ assert_no_lints("ready work", test_linter());}#[test]fn no_lint_bad_at_managing_side_effects() {- assert_no_lints("Bad at managing side-effects", MissingTo::default());+ assert_no_lints("Bad at managing side-effects", test_linter());}#[test]fn no_lint_a_fully_resolved_conflict() {- assert_no_lints("a fully resolved conflict", MissingTo::default());+ assert_no_lints("a fully resolved conflict", test_linter());}#[test]fn no_lint_a_resolved_configuration() {- assert_no_lints("A resolved configuration", MissingTo::default());+ assert_no_lints("A resolved configuration", test_linter());}#[test]fn no_lint_a_fully_resolved_configuration() {- assert_no_lints("A fully resolved configuration", MissingTo::default());+ assert_no_lints("A fully resolved configuration", test_linter());}#[test]fn no_lint_a_resolved_set_of_configuration() {- assert_no_lints("A resolved set of configuration", MissingTo::default());+ assert_no_lints("A resolved set of configuration", test_linter());}#[test]fn no_lint_a_fully_resolved_set_of_configuration() {- assert_no_lints(- "A fully resolved set of configuration",- MissingTo::default(),- );+ assert_no_lints("A fully resolved set of configuration", test_linter());}#[test]fn no_lint_system_produced_a_fully_resolved_set_of_dependencies() {assert_no_lints("System produced a fully resolved set of dependencies",- MissingTo::default(),+ test_linter(),);}#[test]fn no_lint_a_resolved_list_of_parameters() {- assert_no_lints("A resolved list of parameters", MissingTo::default());+ assert_no_lints("A resolved list of parameters", test_linter());}#[test]fn no_lint_a_fully_resolved_list_of_parameters() {- assert_no_lints("A fully resolved list of parameters", MissingTo::default());+ assert_no_lints("A fully resolved list of parameters", test_linter());}#[test]fn no_lint_a_prepared_stranger() {- assert_no_lints("A prepared stranger", MissingTo::default());+ assert_no_lints("A prepared stranger", test_linter());}#[test]fn no_lint_a_fully_prepared_stranger() {- assert_no_lints("A fully prepared stranger", MissingTo::default());+ assert_no_lints("A fully prepared stranger", test_linter());}#[test]fn no_lint_a_prepared_group_of_strangers() {- assert_no_lints("A prepared group of strangers", MissingTo::default());+ assert_no_lints("A prepared group of strangers", test_linter());}#[test]fn no_lint_a_fully_prepared_group_of_strangers() {- assert_no_lints("A fully prepared group of strangers", MissingTo::default());+ assert_no_lints("A fully prepared group of strangers", test_linter());}#[test]fn no_lint_a_nicely_arranged_set_of_flowers() {- assert_no_lints("A nicely arranged bunch of flowers", MissingTo::default());+ assert_no_lints("A nicely arranged bunch of flowers", test_linter());}#[test]fn no_lint_a_recently_forgotten_list_of_names() {- assert_no_lints("A recently forgotten list of names", MissingTo::default());+ assert_no_lints("A recently forgotten list of names", test_linter());}#[test]fn april_16_3188() {- assert_no_lints("I want people like you in my life.", MissingTo::default());+ assert_no_lints("I want people like you in my life.", test_linter());}#[test]fn june_13_3188() {assert_no_lints("Sometimes too much or too little to do. If too much, might be serious about wanting distance from others.",- MissingTo::default(),+ test_linter(),);}}diff --git a/harper-core/src/linting/mod.rs b/harper-core/src/linting/mod.rsindex dabf21580..1fba85cc8 100644--- a/harper-core/src/linting/mod.rs+++ b/harper-core/src/linting/mod.rs@@ -218,6 +218,7 @@ mod phrase_set_corrections;mod pique_interest;mod plural_decades;mod plural_wrong_word_of_phrase;+mod pooled_linter;mod possessive_noun;mod possessive_your;mod progressive_needs_be;@@ -330,6 +331,10 @@ pub use lint_group::{pub use lint_kind::LintKind;pub use map_phrase_linter::MapPhraseLinter;pub use map_phrase_set_linter::MapPhraseSetLinter;+#[cfg(test)]+pub(crate) use pooled_linter::PooledLinter;+#[cfg(test)]+pub(crate) use pooled_linter::for_tests::create_test_pool;pub use suggestion::{Suggestion, SuggestionCollectionExt};use crate::{Document, LSend, render_markdown};diff --git a/harper-core/src/linting/modal_of.rs b/harper-core/src/linting/modal_of.rsindex 9da5d903b..b2b7b5837 100644--- a/harper-core/src/linting/modal_of.rs+++ b/harper-core/src/linting/modal_of.rs@@ -131,43 +131,46 @@ impl ExprLinter for ModalOf {#[cfg(test)]mod tests {use super::ModalOf;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};+ create_test_pool!(ModalOf, ModalOf, ModalOf::default());+// atomic unit tests#[test]fn test_lowercase() {- assert_suggestion_result("could of", ModalOf::default(), "could have");+ assert_suggestion_result("could of", test_linter(), "could have");}#[test]fn test_negative() {- assert_suggestion_result("mightn't of", ModalOf::default(), "mightn't have");+ assert_suggestion_result("mightn't of", test_linter(), "mightn't have");}#[test]fn test_uppercase_negative() {- assert_suggestion_result("Mustn't of", ModalOf::default(), "Mustn't have");+ assert_suggestion_result("Mustn't of", test_linter(), "Mustn't have");}#[test]fn test_false_positive_of_course() {- assert_lint_count("should of course", ModalOf::default(), 0);+ assert_lint_count("should of course", test_linter(), 0);}#[test]fn test_false_positive_the_might_of() {- assert_lint_count("the might of", ModalOf::default(), 0);+ assert_lint_count("the might of", test_linter(), 0);}#[test]fn test_false_positive_great_might_of() {- assert_lint_count("great might of", ModalOf::default(), 0);+ assert_lint_count("great might of", test_linter(), 0);}#[test]fn test_false_positive_capital_negative() {- assert_lint_count("Wouldn't of course", ModalOf::default(), 0);+ assert_lint_count("Wouldn't of course", test_linter(), 0);}// real-world tests@@ -176,7 +179,7 @@ mod tests {fn test_buggy_implementation() {assert_lint_count("... could of just been a buggy implementation",- ModalOf::default(),+ test_linter(),1,);}@@ -185,7 +188,7 @@ mod tests {fn test_missed_one() {assert_lint_count("We already have a function ... that nedb can understand so we might of missed one.",- ModalOf::default(),+ test_linter(),1,);}@@ -194,7 +197,7 @@ mod tests {fn test_user_option() {assert_lint_count("im more likely to believe you might of left in the 'user' option",- ModalOf::default(),+ test_linter(),1,);}@@ -203,7 +206,7 @@ mod tests {fn catches_must_of() {assert_suggestion_result("Ah I must of missed that part.",- ModalOf::default(),+ test_linter(),"Ah I must have missed that part.",);}@@ -212,7 +215,7 @@ mod tests {fn catches_should_of() {assert_lint_count("Yeah I should of just mentioned it should of been a for of.",- ModalOf::default(),+ test_linter(),2,);}@@ -221,7 +224,7 @@ mod tests {fn catches_would_of() {assert_suggestion_result("now this issue would of caused hundreds of thousands of extra lines",- ModalOf::default(),+ test_linter(),"now this issue would have caused hundreds of thousands of extra lines",);}@@ -230,7 +233,7 @@ mod tests {fn doesnt_catch_you_could_of_course() {assert_lint_count("You could of course explicit the else with each possibility",- ModalOf::default(),+ test_linter(),0,);}@@ -239,7 +242,7 @@ mod tests {fn doesnt_catch_compiler_could_of_course() {assert_lint_count("The compiler could of course detect this too",- ModalOf::default(),+ test_linter(),0,);}@@ -248,7 +251,7 @@ mod tests {fn doesnt_catch_might_of_course_be() {assert_lint_count("There might of course be other places where not implementing the IMemberSource might break ...",- ModalOf::default(),+ test_linter(),0,);}@@ -257,7 +260,7 @@ mod tests {fn doesnt_catch_not_a_must_of_course() {assert_lint_count("Not a must of course if the convention should be .ts",- ModalOf::default(),+ test_linter(),0,);}@@ -266,7 +269,7 @@ mod tests {fn doesnt_catch_must_of_course_also() {assert_lint_count("the schedular must of course also have run through",- ModalOf::default(),+ test_linter(),0,);}@@ -275,7 +278,7 @@ mod tests {fn doesnt_catch_should_of_course_not() {assert_lint_count("not being local should of course not be supported",- ModalOf::default(),+ test_linter(),0,);}@@ -284,61 +287,57 @@ mod tests {fn doesnt_catch_would_of_course_just() {assert_lint_count("I would of course just test this by compiling with MATX_MULTI_GPU=ON",- ModalOf::default(),+ test_linter(),0,);}#[test]fn doesnt_catch_to_take_on_the_full_might_of_nato() {- assert_lint_count("To take on the full might of NATO.", ModalOf::default(), 0);+ assert_lint_count("To take on the full might of NATO.", test_linter(), 0);}#[test]fn doesnt_catch_mixed_case_of_course() {- assert_lint_count(- "... for now you could of Course put ...",- ModalOf::default(),- 0,- );+ assert_lint_count("... for now you could of Course put ...", test_linter(), 0);}#[test]fn catches_mixed_case_could_of_put() {- assert_lint_count("... for now you could of Put ...", ModalOf::default(), 1);+ assert_lint_count("... for now you could of Put ...", test_linter(), 1);}#[test]fn doesnt_catch_noun_will_of() {- assert_lint_count("the will of the many", ModalOf::default(), 0);+ assert_lint_count("the will of the many", test_linter(), 0);}#[test]fn doesnt_catch_noun_will_of_edgecase() {- assert_lint_count("he sent us a will of his", ModalOf::default(), 0);+ assert_lint_count("he sent us a will of his", test_linter(), 0);}#[test]fn catch_modal_will_of() {- assert_lint_count("that will of an impact", ModalOf::default(), 1);+ assert_lint_count("that will of an impact", test_linter(), 1);}#[test]fn catch_may_of() {assert_suggestion_result("I may of made a mistake",- ModalOf::default(),+ test_linter(),"I may have made a mistake",);}#[test]fn dont_flag_in_may_of_last_year_bug_2786() {- assert_no_lints("This happened in May of last year.", ModalOf::default());+ assert_no_lints("This happened in May of last year.", test_linter());}#[test]fn dont_flag_can_of_red_bull_2807() {- assert_no_lints("I drank a can of Red Bull.", ModalOf::default());+ assert_no_lints("I drank a can of Red Bull.", test_linter());}}diff --git a/harper-core/src/linting/need_to_noun.rs b/harper-core/src/linting/need_to_noun.rsindex b8f6466c8..806628867 100644--- a/harper-core/src/linting/need_to_noun.rs+++ b/harper-core/src/linting/need_to_noun.rs@@ -88,6 +88,9 @@ impl ExprLinter for NeedToNoun {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(NeedToNoun, NeedToNoun, NeedToNoun::default());use super::NeedToNoun;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};@@ -95,48 +98,40 @@ mod tests {fn flags_need_to_noun() {assert_suggestion_result("I need to information now.",- NeedToNoun::default(),+ test_linter(),"I need the information now.",);}#[test]fn allows_need_to_verb() {- assert_lint_count("I need to leave now.", NeedToNoun::default(), 0);+ assert_lint_count("I need to leave now.", test_linter(), 0);}#[test]fn allows_need_to_finish() {assert_lint_count("I need to finish this report by tomorrow.",- NeedToNoun::default(),+ test_linter(),0,);}#[test]fn allows_need_to_call() {- assert_lint_count(- "You need to call your mother tonight.",- NeedToNoun::default(),- 0,- );+ assert_lint_count("You need to call your mother tonight.", test_linter(), 0);}#[test]fn allows_need_to_talk() {- assert_lint_count(- "We need to talk about the budget.",- NeedToNoun::default(),- 0,- );+ assert_lint_count("We need to talk about the budget.", test_linter(), 0);}#[test]fn allows_need_to_leave() {assert_lint_count("They need to leave early to catch the train.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -145,7 +140,7 @@ mod tests {fn allows_need_to_practice() {assert_lint_count("She needs to practice her German more often.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -154,7 +149,7 @@ mod tests {fn allows_need_to_fix() {assert_lint_count("He needs to fix his bike before the weekend.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -163,25 +158,21 @@ mod tests {fn allows_need_to_decide() {assert_lint_count("We need to decide where to go for dinner.",- NeedToNoun::default(),+ test_linter(),0,);}#[test]fn allows_need_to_update() {- assert_lint_count(- "You need to update your password.",- NeedToNoun::default(),- 0,- );+ assert_lint_count("You need to update your password.", test_linter(), 0);}#[test]fn allows_need_to_take() {assert_lint_count("I need to take a break and get some fresh air.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -190,7 +181,7 @@ mod tests {fn allows_need_to_clean() {assert_lint_count("They need to clean the house before guests arrive.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -199,7 +190,7 @@ mod tests {fn avoids_false_positive_for_need_to_verify() {assert_lint_count("I need to verify the expenses before submission.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -208,7 +199,7 @@ mod tests {fn flags_need_to_compiler() {assert_suggestion_result("We simply don't need to compiler to do as much work anymore.",- NeedToNoun::default(),+ test_linter(),"We simply don't need the compiler to do as much work anymore.",);}@@ -217,7 +208,7 @@ mod tests {fn flags_need_to_verification() {assert_suggestion_result("I need to verification before logging in.",- NeedToNoun::default(),+ test_linter(),"I need the verification before logging in.",);}@@ -226,23 +217,20 @@ mod tests {fn allows_need_to_report() {assert_no_lints("We need to report before the meeting starts.",- NeedToNoun::default(),+ test_linter(),);}#[test]fn allows_need_to_password() {- assert_no_lints(- "You need to password to access the server.",- NeedToNoun::default(),- );+ assert_no_lints("You need to password to access the server.", test_linter());}#[test]fn flags_need_to_data() {assert_suggestion_result("They need to data analyzed by tomorrow.",- NeedToNoun::default(),+ test_linter(),"They need the data analyzed by tomorrow.",);}@@ -251,7 +239,7 @@ mod tests {fn flags_need_to_approval() {assert_suggestion_result("She will need to approval of her manager first.",- NeedToNoun::default(),+ test_linter(),"She will need the approval of her manager first.",);}@@ -260,7 +248,7 @@ mod tests {fn allows_need_to_backup() {assert_no_lints("We might need to backup if the main system fails.",- NeedToNoun::default(),+ test_linter(),);}@@ -268,23 +256,20 @@ mod tests {fn allows_need_to_permit() {assert_no_lints("He didn’t realize he would need to permit to film there.",- NeedToNoun::default(),+ test_linter(),);}#[test]fn allows_need_to_tools() {- assert_no_lints(- "You’ll need to right tools to fix that.",- NeedToNoun::default(),- );+ assert_no_lints("You’ll need to right tools to fix that.", test_linter());}#[test]fn allows_need_to_context() {assert_no_lints("We need to context to make sense of his decision.",- NeedToNoun::default(),+ test_linter(),);}@@ -292,20 +277,20 @@ mod tests {fn allows_need_to_funds() {assert_no_lints("They need to funds released before construction begins.",- NeedToNoun::default(),+ test_linter(),);}#[test]fn allows_need_to_silence() {- assert_no_lints("I need to silence to think clearly.", NeedToNoun::default());+ assert_no_lints("I need to silence to think clearly.", test_linter());}#[test]fn flags_needs_to_approval() {assert_suggestion_result("She needs to approval from her advisor.",- NeedToNoun::default(),+ test_linter(),"She needs the approval from her advisor.",);}@@ -314,7 +299,7 @@ mod tests {fn avoids_false_positive_for_needs_to_coordinate() {assert_lint_count("She needs to collaborate with everyone on the plan.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -323,25 +308,21 @@ mod tests {fn flags_needs_to_verification() {assert_suggestion_result("He needs to verification ready before the audit.",- NeedToNoun::default(),+ test_linter(),"He needs the verification ready before the audit.",);}#[test]fn allows_needs_to_finalize() {- assert_lint_count(- "She needs to finalize the schedule.",- NeedToNoun::default(),- 0,- );+ assert_lint_count("She needs to finalize the schedule.", test_linter(), 0);}#[test]fn allows_needed_to_permit() {assert_no_lints("They needed to permit before entering the site.",- NeedToNoun::default(),+ test_linter(),);}@@ -349,7 +330,7 @@ mod tests {fn avoids_false_positive_for_needed_to_explain() {assert_lint_count("They needed to explain the new policy carefully.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -358,7 +339,7 @@ mod tests {fn catches_false_negative_for_needed_to_authorization() {assert_suggestion_result("They needed to authorization before proceeding.",- NeedToNoun::default(),+ test_linter(),"They needed the authorization before proceeding.",);}@@ -367,7 +348,7 @@ mod tests {fn allows_needed_to_file() {assert_lint_count("They needed to file the paperwork before noon.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -376,7 +357,7 @@ mod tests {fn flags_needing_to_documentation() {assert_suggestion_result("Needing to documentation slowed the entire process.",- NeedToNoun::default(),+ test_linter(),"Needing the documentation slowed the entire process.",);}@@ -385,7 +366,7 @@ mod tests {fn avoids_false_positive_for_needing_to_calibrate() {assert_lint_count("Needing to calibrate the equipment delayed us slightly.",- NeedToNoun::default(),+ test_linter(),0,);}@@ -394,7 +375,7 @@ mod tests {fn catches_false_negative_for_needing_to_confirmation() {assert_suggestion_result("Needing to confirmation from legal stalled the launch.",- NeedToNoun::default(),+ test_linter(),"Needing the confirmation from legal stalled the launch.",);}@@ -403,21 +384,21 @@ mod tests {fn allows_needing_to_call() {assert_lint_count("Needing to call your mother is stressful.",- NeedToNoun::default(),+ test_linter(),0,);}#[test]fn allows_issue_2252() {- assert_no_lints("Things I need to do today:", NeedToNoun::default());+ assert_no_lints("Things I need to do today:", test_linter());}#[test]fn allows_install() {assert_no_lints("You need to install it separately, as it's a standalone application.",- NeedToNoun::default(),+ test_linter(),);}@@ -425,7 +406,7 @@ mod tests {fn allows_lay() {assert_no_lints("Okay, this is a long one, but I feel like I need to lay everything out.",- NeedToNoun::default(),+ test_linter(),);}@@ -433,7 +414,7 @@ mod tests {fn allows_overcome() {assert_no_lints("We believe every family deserves the opportunity to flourish, and we are committed to providing the resources they need to overcome adversity.",- NeedToNoun::default(),+ test_linter(),);}@@ -441,7 +422,7 @@ mod tests {fn allows_need_to_run_into_2433() {assert_no_lints("So that they don't need to run into this problem in the future.",- NeedToNoun::default(),+ test_linter(),);}@@ -449,20 +430,20 @@ mod tests {fn allows_need_to_match_2446() {assert_no_lints("You don't need to match string errors explicitly.",- NeedToNoun::default(),+ test_linter(),);}#[test]fn allows_need_to_match_exactly_2446() {- assert_no_lints("They need to match exactly.", NeedToNoun::default());+ assert_no_lints("They need to match exactly.", test_linter());}#[test]fn allows_need_to_use_php_code_fuzz() {assert_no_lints("To display the custom field data on your website, you'll likely need to use PHP code within your theme files.",- NeedToNoun::default(),+ test_linter(),);}@@ -470,7 +451,7 @@ mod tests {fn allows_need_to_display_images_fuzz() {assert_no_lints("I'm building a photography portfolio site for a client and need to display images in a responsive gallery.",- NeedToNoun::default(),+ test_linter(),);}@@ -478,7 +459,7 @@ mod tests {fn allows_need_to_build_brighter_futures_fuzz() {assert_no_lints("At Haven House, our mission is to provide families with the resources they need to build brighter futures.",- NeedToNoun::default(),+ test_linter(),);}@@ -486,7 +467,7 @@ mod tests {fn allows_need_to_redefine_success_fuzz() {assert_no_lints("We need to redefine success to include wellbeing and sustainability.",- NeedToNoun::default(),+ test_linter(),);}@@ -494,7 +475,7 @@ mod tests {fn allows_need_to_shift_from_fuzz() {assert_no_lints("We need to shift from a deficit model to an abundance model.",- NeedToNoun::default(),+ test_linter(),);}@@ -502,7 +483,7 @@ mod tests {fn allows_need_to_research_and_choose_fuzz() {assert_no_lints("This means you need to research and choose adapters carefully.",- NeedToNoun::default(),+ test_linter(),);}@@ -510,7 +491,7 @@ mod tests {fn allows_need_to_model_healthy_habits_fuzz() {assert_no_lints("Leaders need to model healthy work habits and create a safe space for employees.",- NeedToNoun::default(),+ test_linter(),);}@@ -518,7 +499,7 @@ mod tests {fn allows_need_to_start_2320() {assert_no_lints("You need to start the server before running tests.",- NeedToNoun::default(),+ test_linter(),);}@@ -526,7 +507,7 @@ mod tests {fn allows_need_to_have_2320() {assert_no_lints("You need to have a valid license to use this software.",- NeedToNoun::default(),+ test_linter(),);}@@ -534,7 +515,7 @@ mod tests {fn allows_need_to_configure_2320() {assert_no_lints("You need to configure the database connection first.",- NeedToNoun::default(),+ test_linter(),);}@@ -542,7 +523,7 @@ mod tests {fn allows_need_to_set_2320() {assert_no_lints("You need to set the environment variable before deploying.",- NeedToNoun::default(),+ test_linter(),);}@@ -550,7 +531,7 @@ mod tests {fn allows_need_to_send_2320() {assert_no_lints("You need to send the request with the correct headers.",- NeedToNoun::default(),+ test_linter(),);}@@ -558,7 +539,7 @@ mod tests {fn allows_need_to_receive_2320() {assert_no_lints("You need to receive confirmation before proceeding.",- NeedToNoun::default(),+ test_linter(),);}}diff --git a/harper-core/src/linting/noun_verb_confusion/mod.rs b/harper-core/src/linting/noun_verb_confusion/mod.rsindex 685488c27..813d76fc2 100644--- a/harper-core/src/linting/noun_verb_confusion/mod.rs+++ b/harper-core/src/linting/noun_verb_confusion/mod.rs@@ -31,18 +31,25 @@ merge_linters! {#[cfg(test)]mod tests {use super::NounVerbConfusion;+ use crate::linting::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};+ create_test_pool!(+ NounVerbConfusion,+ NounVerbConfusion,+ NounVerbConfusion::default()+ );+#[test]fn corrects_good_advise() {- assert_suggestion_result("Good advise", NounVerbConfusion::default(), "Good advice");+ assert_suggestion_result("Good advise", test_linter(), "Good advice");}#[test]fn corrects_bad_advise() {assert_suggestion_result("I just wanted to bring attention to this because it stood out to me as potentially bad advise.",- NounVerbConfusion::default(),+ test_linter(),"I just wanted to bring attention to this because it stood out to me as potentially bad advice.",);}@@ -51,7 +58,7 @@ mod tests {fn dont_flag_correct_better_advise() {assert_lint_count("Hello! I am an engineer at Plexon and am conducting tests with Kilosort4 so we can better advise our clients.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -61,7 +68,7 @@ mod tests {fn correct_better_advise() {assert_suggestion_result("Maybe this will be a decent idea, .or anybody has better advise :)",- NounVerbConfusion::default(),+ test_linter(),"Maybe this will be a decent idea, .or anybody has better advice :)",);}@@ -70,7 +77,7 @@ mod tests {fn dont_flag_correct_better_believe() {assert_lint_count("You'd better believe this is bbedit-gist-maker.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -79,7 +86,7 @@ mod tests {fn correct_strong_believe() {assert_suggestion_result("cause my strong believe is that we must give any user to describe whether a post is meant factual",- NounVerbConfusion::default(),+ test_linter(),"cause my strong belief is that we must give any user to describe whether a post is meant factual",);}@@ -88,7 +95,7 @@ mod tests {fn correct_deep_breathe() {assert_suggestion_result("Take deep breathe and Do it again!",- NounVerbConfusion::default(),+ test_linter(),"Take deep breath and Do it again!",);}@@ -97,18 +104,14 @@ mod tests {fn correct_bad_intend() {assert_suggestion_result("What do you do if you only see slightly longer posts that may still be acceptable (and not bad intend from the poster)",- NounVerbConfusion::default(),+ test_linter(),"What do you do if you only see slightly longer posts that may still be acceptable (and not bad intent from the poster)",);}#[test]fn corrects_belief_instead_of_verb() {- assert_suggestion_result(- "I belief in you.",- NounVerbConfusion::default(),- "I believe in you.",- );+ assert_suggestion_result("I belief in you.", test_linter(), "I believe in you.");}#[test]@@ -116,19 +119,19 @@ mod tests {fn corrects_breath_instead_of_verb() {assert_suggestion_result("Remember to breath deeply.",- NounVerbConfusion::default(),+ test_linter(),"Remember to breathe deeply.",);}#[test]fn does_not_flag_correct_believe() {- assert_lint_count("I believe in you.", NounVerbConfusion::default(), 0);+ assert_lint_count("I believe in you.", test_linter(), 0);}#[test]fn does_not_flag_correct_breath() {- assert_lint_count("Take a deep breath.", NounVerbConfusion::default(), 0);+ assert_lint_count("Take a deep breath.", test_linter(), 0);}// real-world example unit tests@@ -137,7 +140,7 @@ mod tests {fn fix_when_i_breath_you_breath() {assert_suggestion_result("When I breath, you breath!",- NounVerbConfusion::default(),+ test_linter(),"When I breathe, you breathe!",);}@@ -146,7 +149,7 @@ mod tests {fn fix_weather_climate_and_the_air_we_breath() {assert_suggestion_result("Weather Climate and the Air We Breath",- NounVerbConfusion::default(),+ test_linter(),"Weather Climate and the Air We Breathe",);}@@ -155,7 +158,7 @@ mod tests {fn fix_always_breath() {assert_suggestion_result("breathing. remember to always breath.",- NounVerbConfusion::default(),+ test_linter(),"breathing. remember to always breathe.",);}@@ -164,7 +167,7 @@ mod tests {fn fix_never_breath_a_word() {assert_suggestion_result("And never breath a word about your loss; If you can force your heart and nerve and sinew.",- NounVerbConfusion::default(),+ test_linter(),"And never breathe a word about your loss; If you can force your heart and nerve and sinew.",);}@@ -173,7 +176,7 @@ mod tests {fn fix_breath_for_seconds() {assert_suggestion_result("Once turned on, the LED on the TX unit would breath for a few seconds, then go completely dead and not responding to objects in front of the sensors.",- NounVerbConfusion::default(),+ test_linter(),"Once turned on, the LED on the TX unit would breathe for a few seconds, then go completely dead and not responding to objects in front of the sensors.",);}@@ -182,7 +185,7 @@ mod tests {fn fix_breath_a_little_more_life() {assert_suggestion_result("... up to 12% more performance, could breath a little more life into systems as old as Sandy Bridge.",- NounVerbConfusion::default(),+ test_linter(),"... up to 12% more performance, could breathe a little more life into systems as old as Sandy Bridge.",);}@@ -191,7 +194,7 @@ mod tests {fn fix_the_diversity_we_breath() {assert_suggestion_result("The Diversity We Breath: Community Diversity",- NounVerbConfusion::default(),+ test_linter(),"The Diversity We Breathe: Community Diversity",);}@@ -200,7 +203,7 @@ mod tests {fn fix_belief() {assert_suggestion_result("While I have no plans to return to aerospace I belief it gives me a unique perspective to many challenges.",- NounVerbConfusion::default(),+ test_linter(),"While I have no plans to return to aerospace I believe it gives me a unique perspective to many challenges.",);}@@ -209,7 +212,7 @@ mod tests {fn fix_we_belief() {assert_suggestion_result("In contrast to other vendors in e-mobility, we belief that true transparency is only trustworthy if the entire process ...",- NounVerbConfusion::default(),+ test_linter(),"In contrast to other vendors in e-mobility, we believe that true transparency is only trustworthy if the entire process ...",);}@@ -219,7 +222,7 @@ mod tests {fn fix_i_can_breath() {assert_suggestion_result("Steps to reproduce Expected behaviour I can breath underwater.",- NounVerbConfusion::default(),+ test_linter(),"Steps to reproduce Expected behaviour I can breathe underwater.",);}@@ -228,7 +231,7 @@ mod tests {fn fix_caps_should_breath() {assert_suggestion_result("CAPS 1 2 3 4 5 A B C D SHOULD BREATH A BIT MORE ?",- NounVerbConfusion::default(),+ test_linter(),"CAPS 1 2 3 4 5 A B C D SHOULD BREATHE A BIT MORE ?",);}@@ -237,7 +240,7 @@ mod tests {fn fix_can_you_advice_me() {assert_suggestion_result("Can you advice me how to train?",- NounVerbConfusion::default(),+ test_linter(),"Can you advise me how to train?",);}@@ -246,7 +249,7 @@ mod tests {fn fix_we_can_advice_you() {assert_suggestion_result("Feel free to share more details about your use case, so we can advice you specifically based on your case.",- NounVerbConfusion::default(),+ test_linter(),"Feel free to share more details about your use case, so we can advise you specifically based on your case.",);}@@ -255,7 +258,7 @@ mod tests {fn fix_would_advice_against() {assert_suggestion_result("So that I would advice against using a spindle in laser mode.",- NounVerbConfusion::default(),+ test_linter(),"So that I would advise against using a spindle in laser mode.",);}@@ -264,7 +267,7 @@ mod tests {fn fix_advice_to_listen() {assert_suggestion_result("The idea of this applicaton was inspired by Ray Dalio, who always advice to listen to people who know more than us by experience.",- NounVerbConfusion::default(),+ test_linter(),"The idea of this applicaton was inspired by Ray Dalio, who always advise to listen to people who know more than us by experience.",);}@@ -274,7 +277,7 @@ mod tests {fn dont_fix_advice_on_that() {assert_lint_count("I don't do table returning functions in my code so can't offer you advice on that.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -283,7 +286,7 @@ mod tests {fn fix_advice_to_stick_with_openvscode() {assert_suggestion_result("But unless you really need it, I would advice to stick with openvscode as there are nearly the same.",- NounVerbConfusion::default(),+ test_linter(),"But unless you really need it, I would advise to stick with openvscode as there are nearly the same.",);}@@ -292,7 +295,7 @@ mod tests {fn fix_advice_to_back_up_os_image() {assert_suggestion_result("I would advice to back up all OS image before any update, because you could lose something what was working previously.",- NounVerbConfusion::default(),+ test_linter(),"I would advise to back up all OS image before any update, because you could lose something what was working previously.",);}@@ -301,7 +304,7 @@ mod tests {fn fix_advice_to_use_ms_store() {assert_suggestion_result("I know we can always advice to use the MS store to download JASP instead",- NounVerbConfusion::default(),+ test_linter(),"I know we can always advise to use the MS store to download JASP instead",);}@@ -310,7 +313,7 @@ mod tests {fn fix_should_intent_be() {assert_suggestion_result("Should intent be on the blocklist?",- NounVerbConfusion::default(),+ test_linter(),"Should intent be on the blocklist?",);}@@ -319,7 +322,7 @@ mod tests {fn fix_if_you_intent() {assert_suggestion_result("If you intent to use a 64 bits machine, change line 74",- NounVerbConfusion::default(),+ test_linter(),"If you intend to use a 64 bits machine, change line 74",);}@@ -328,7 +331,7 @@ mod tests {fn fix_what_you_would_intent_to_do() {assert_suggestion_result("May I ask what you would intent to do with such a feature?",- NounVerbConfusion::default(),+ test_linter(),"May I ask what you would intend to do with such a feature?",);}@@ -337,7 +340,7 @@ mod tests {fn dont_flag_intent_records() {assert_lint_count("there are always intent records associated to the txns",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -346,7 +349,7 @@ mod tests {fn fix_did_you_always_intent_to() {assert_suggestion_result("Did you always intent to fight malware? No.",- NounVerbConfusion::default(),+ test_linter(),"Did you always intend to fight malware? No.",);}@@ -355,7 +358,7 @@ mod tests {fn fix_we_recommend_you_create_a_new_issue_on_github_explaining_what_you_intent_to_do() {assert_suggestion_result("... we recommend you create a new issue on github explaining what you intent to do.",- NounVerbConfusion::default(),+ test_linter(),"... we recommend you create a new issue on github explaining what you intend to do.",);}@@ -364,7 +367,7 @@ mod tests {fn fix_intent_to_use_non_imported_symbol() {assert_suggestion_result("There's a warning reported for this code, saying that it may intent to use non-imported symbol",- NounVerbConfusion::default(),+ test_linter(),"There's a warning reported for this code, saying that it may intend to use non-imported symbol",);}@@ -375,25 +378,21 @@ mod tests {fn fix_to_emphasis_the() {assert_suggestion_result("This one could be used in a dialog to emphasis the surprise.",- NounVerbConfusion::default(),+ test_linter(),"This one could be used in a dialog to emphasize the surprise.",);}#[test]fn allow_to_emphasis_at_end() {- assert_lint_count(- "Changes literal underscores to emphasis",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("Changes literal underscores to emphasis", test_linter(), 0);}#[test]fn allow_to_intent_adjective() {assert_lint_count("Cleanup passing statistics to intent aware iterator",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -402,7 +401,7 @@ mod tests {fn fix_to_advice_a_class() {assert_suggestion_result("How to advice a class that have been intercepted by another javaagent",- NounVerbConfusion::default(),+ test_linter(),"How to advise a class that have been intercepted by another javaagent",);}@@ -411,7 +410,7 @@ mod tests {fn fix_to_breath_some() {assert_suggestion_result("You go to the balcony to breath some fresh air and look down at the things outside.",- NounVerbConfusion::default(),+ test_linter(),"You go to the balcony to breathe some fresh air and look down at the things outside.",);}@@ -420,7 +419,7 @@ mod tests {fn fix_to_emphasis_a() {assert_suggestion_result("we'd like to emphasis a few points below",- NounVerbConfusion::default(),+ test_linter(),"we'd like to emphasize a few points below",);}@@ -429,7 +428,7 @@ mod tests {fn fix_to_advice_their() {assert_suggestion_result("People who are managing this situation tend to advice their users to lock+unlock their screen",- NounVerbConfusion::default(),+ test_linter(),"People who are managing this situation tend to advise their users to lock+unlock their screen",);}@@ -440,7 +439,7 @@ mod tests {fn fix_positive_affect_on_small_businesses() {assert_suggestion_result("The new law had a positive affect on small businesses.",- NounVerbConfusion::default(),+ test_linter(),"The new law had a positive effect on small businesses.",);}@@ -449,7 +448,7 @@ mod tests {fn fix_measured_the_affect_of_caffeine() {assert_suggestion_result("We measured the affect of caffeine on reaction time.",- NounVerbConfusion::default(),+ test_linter(),"We measured the effect of caffeine on reaction time.",);}@@ -458,7 +457,7 @@ mod tests {fn fix_side_affects_included_nausea() {assert_suggestion_result("The side affects included nausea and fatigue.",- NounVerbConfusion::default(),+ test_linter(),"The side effects included nausea and fatigue.",);}@@ -467,7 +466,7 @@ mod tests {fn fix_cause_and_affect_not_same() {assert_suggestion_result("Cause and affect are not the same thing.",- NounVerbConfusion::default(),+ test_linter(),"Cause and effect are not the same thing.",);}@@ -476,7 +475,7 @@ mod tests {fn fix_change_will_have_an_affect_on_revenue() {assert_suggestion_result("The change will have an affect on our revenue.",- NounVerbConfusion::default(),+ test_linter(),"The change will have an effect on our revenue.",);}@@ -485,7 +484,7 @@ mod tests {fn fix_medicine_took_affect_within_minutes() {assert_suggestion_result("The medicine took affect within minutes.",- NounVerbConfusion::default(),+ test_linter(),"The medicine took effect within minutes.",);}@@ -494,7 +493,7 @@ mod tests {fn fix_policy_will_come_into_affect() {assert_suggestion_result("The policy will come into affect on October 1.",- NounVerbConfusion::default(),+ test_linter(),"The policy will come into effect on October 1.",);}@@ -503,7 +502,7 @@ mod tests {fn fix_rules_are_now_in_affect() {assert_suggestion_result("The rules are now in affect.",- NounVerbConfusion::default(),+ test_linter(),"The rules are now in effect.",);}@@ -512,7 +511,7 @@ mod tests {fn fix_with_immediate_affect_office_closed() {assert_suggestion_result("With immediate affect, the office is closed.",- NounVerbConfusion::default(),+ test_linter(),"With immediate effect, the office is closed.",);}@@ -521,7 +520,7 @@ mod tests {fn fix_stunning_special_affects() {assert_suggestion_result("The director used stunning special affects.",- NounVerbConfusion::default(),+ test_linter(),"The director used stunning special effects.",);}@@ -530,7 +529,7 @@ mod tests {fn fix_placebo_affect_can_be_powerful() {assert_suggestion_result("The placebo affect can be powerful.",- NounVerbConfusion::default(),+ test_linter(),"The placebo effect can be powerful.",);}@@ -539,7 +538,7 @@ mod tests {fn fix_ripple_affect_across_market() {assert_suggestion_result("We felt the ripple affect across the entire market.",- NounVerbConfusion::default(),+ test_linter(),"We felt the ripple effect across the entire market.",);}@@ -548,7 +547,7 @@ mod tests {fn fix_snowball_affect_amplified_problem() {assert_suggestion_result("The snowball affect amplified the problem.",- NounVerbConfusion::default(),+ test_linter(),"The snowball effect amplified the problem.",);}@@ -557,7 +556,7 @@ mod tests {fn fix_knock_on_affect_throughout_team() {assert_suggestion_result("That decision had a knock-on affect throughout the team.",- NounVerbConfusion::default(),+ test_linter(),"That decision had a knock-on effect throughout the team.",);}@@ -566,7 +565,7 @@ mod tests {fn fix_greenhouse_affect_warms_planet() {assert_suggestion_result("The greenhouse affect warms the planet.",- NounVerbConfusion::default(),+ test_linter(),"The greenhouse effect warms the planet.",);}@@ -575,7 +574,7 @@ mod tests {fn fix_apology_had_little_affect() {assert_suggestion_result("Her apology had little affect.",- NounVerbConfusion::default(),+ test_linter(),"Her apology had little effect.",);}@@ -584,7 +583,7 @@ mod tests {fn fix_settings_go_into_affect() {assert_suggestion_result("The new settings go into affect after a restart.",- NounVerbConfusion::default(),+ test_linter(),"The new settings go into effect after a restart.",);}@@ -593,7 +592,7 @@ mod tests {fn fix_put_plan_into_affect() {assert_suggestion_result("They put the new plan into affect last week.",- NounVerbConfusion::default(),+ test_linter(),"They put the new plan into effect last week.",);}@@ -602,7 +601,7 @@ mod tests {fn fix_contract_comes_into_affect() {assert_suggestion_result("The contract comes into affect at midnight.",- NounVerbConfusion::default(),+ test_linter(),"The contract comes into effect at midnight.",);}@@ -611,7 +610,7 @@ mod tests {fn fix_warning_had_no_affect_on_behavior() {assert_suggestion_result("The warning had no affect on his behavior.",- NounVerbConfusion::default(),+ test_linter(),"The warning had no effect on his behavior.",);}@@ -620,7 +619,7 @@ mod tests {fn fix_inflation_had_opposite_affect() {assert_suggestion_result("Inflation had the opposite affect than expected.",- NounVerbConfusion::default(),+ test_linter(),"Inflation had the opposite effect than expected.",);}@@ -629,7 +628,7 @@ mod tests {fn fix_regulation_remains_in_affect() {assert_suggestion_result("The regulation remains in affect until further notice.",- NounVerbConfusion::default(),+ test_linter(),"The regulation remains in effect until further notice.",);}@@ -638,7 +637,7 @@ mod tests {fn fix_app_changes_take_affect() {assert_suggestion_result("The app changes take affect next week.",- NounVerbConfusion::default(),+ test_linter(),"The app changes take effect next week.",);}@@ -647,7 +646,7 @@ mod tests {fn fix_sound_affects_were_added() {assert_suggestion_result("Sound affects were added in post.",- NounVerbConfusion::default(),+ test_linter(),"Sound effects were added in post.",);}@@ -658,7 +657,7 @@ mod tests {fn corrects_noun_subject_effects_object() {assert_suggestion_result("System outages effect our customers.",- NounVerbConfusion::default(),+ test_linter(),"System outages affect our customers.",);}@@ -667,7 +666,7 @@ mod tests {fn corrects_effects_variant() {assert_suggestion_result("This policy effects employee morale.",- NounVerbConfusion::default(),+ test_linter(),"This policy affects employee morale.",);}@@ -676,34 +675,26 @@ mod tests {fn ignores_effect_change_idiom() {assert_lint_count("Leaders work to effect change in their communities.",- NounVerbConfusion::default(),+ test_linter(),0,);}#[test]fn ignores_effect_noun_phrase() {- assert_lint_count(- "The effect your plan had was dramatic.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("The effect your plan had was dramatic.", test_linter(), 0);}#[test]fn ignores_effect_as_result_noun() {- assert_lint_count(- "The effect was immediate and obvious.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("The effect was immediate and obvious.", test_linter(), 0);}#[test]fn ignores_to_effect_substitutions() {assert_lint_count("or it may be desired to effect substitutions",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -712,25 +703,21 @@ mod tests {fn ignores_effect_followed_by_of_phrase() {assert_lint_count("We measured the effect of caffeine on sleep.",- NounVerbConfusion::default(),+ test_linter(),0,);}#[test]fn ignores_side_effects_usage() {- assert_lint_count(- "Side effects may include mild nausea.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("Side effects may include mild nausea.", test_linter(), 0);}#[test]fn ignores_special_effects_phrase() {assert_lint_count("She admired the special effects in the film.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -739,7 +726,7 @@ mod tests {fn ignores_effect_in_cause_and_effect() {assert_lint_count("The diagram explains cause and effect relationships.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -748,7 +735,7 @@ mod tests {fn ignores_effects_with_pronoun_subject() {assert_lint_count("Those effects were less severe than expected.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -757,7 +744,7 @@ mod tests {fn corrects_tariff_effect_import_prices() {assert_suggestion_result("The new tariff will effect import prices next quarter.",- NounVerbConfusion::default(),+ test_linter(),"The new tariff will affect import prices next quarter.",);}@@ -766,7 +753,7 @@ mod tests {fn corrects_droughts_effect_crop_yields() {assert_suggestion_result("Prolonged droughts severely effect crop yields across the valley.",- NounVerbConfusion::default(),+ test_linter(),"Prolonged droughts severely affect crop yields across the valley.",);}@@ -775,7 +762,7 @@ mod tests {fn corrects_caffeine_effect_sleep() {assert_suggestion_result("Caffeine can effect your sleep architecture.",- NounVerbConfusion::default(),+ test_linter(),"Caffeine can affect your sleep architecture.",);}@@ -784,7 +771,7 @@ mod tests {fn corrects_bug_effect_devices() {assert_suggestion_result("The firmware bug doesn't effect older devices.",- NounVerbConfusion::default(),+ test_linter(),"The firmware bug doesn't affect older devices.",);}@@ -793,7 +780,7 @@ mod tests {fn corrects_sarcasm_effect_morale() {assert_suggestion_result("Her sarcasm seemed to effect the team's morale.",- NounVerbConfusion::default(),+ test_linter(),"Her sarcasm seemed to affect the team's morale.",);}@@ -802,7 +789,7 @@ mod tests {fn corrects_outage_effect_timeline() {assert_suggestion_result("How will this outage effect our deployment timeline?",- NounVerbConfusion::default(),+ test_linter(),"How will this outage affect our deployment timeline?",);}@@ -811,7 +798,7 @@ mod tests {fn corrects_temperatures_effect_battery() {assert_suggestion_result("Cold temperatures drastically effect lithium-ion battery performance.",- NounVerbConfusion::default(),+ test_linter(),"Cold temperatures drastically affect lithium-ion battery performance.",);}@@ -820,7 +807,7 @@ mod tests {fn corrects_policy_effect_eligibility() {assert_suggestion_result("The policy change could effect your eligibility for benefits.",- NounVerbConfusion::default(),+ test_linter(),"The policy change could affect your eligibility for benefits.",);}@@ -829,7 +816,7 @@ mod tests {fn corrects_variables_effect_results() {assert_suggestion_result("These confounding variables may effect the study's results.",- NounVerbConfusion::default(),+ test_linter(),"These confounding variables may affect the study's results.",);}@@ -838,7 +825,7 @@ mod tests {fn corrects_fans_effect_concentration() {assert_suggestion_result("The noisy HVAC fans constantly effect concentration in the lab.",- NounVerbConfusion::default(),+ test_linter(),"The noisy HVAC fans constantly affect concentration in the lab.",);}@@ -847,7 +834,7 @@ mod tests {fn corrects_hormones_effect_immunity() {assert_suggestion_result("Stress hormones can effect immune response during recovery.",- NounVerbConfusion::default(),+ test_linter(),"Stress hormones can affect immune response during recovery.",);}@@ -856,7 +843,7 @@ mod tests {fn corrects_pacing_effect_engagement() {assert_suggestion_result("The instructor's pacing tended to effect student engagement.",- NounVerbConfusion::default(),+ test_linter(),"The instructor's pacing tended to affect student engagement.",);}@@ -865,7 +852,7 @@ mod tests {fn corrects_humidity_effect_paint() {assert_suggestion_result("Humidity levels directly effect paint curing time.",- NounVerbConfusion::default(),+ test_linter(),"Humidity levels directly affect paint curing time.",);}@@ -874,7 +861,7 @@ mod tests {fn corrects_exchange_effect_invoice() {assert_suggestion_result("The exchange rate will surely effect the final invoice.",- NounVerbConfusion::default(),+ test_linter(),"The exchange rate will surely affect the final invoice.",);}@@ -883,7 +870,7 @@ mod tests {fn corrects_brightness_effect_contrast() {assert_suggestion_result("Screen brightness settings can effect perceived contrast.",- NounVerbConfusion::default(),+ test_linter(),"Screen brightness settings can affect perceived contrast.",);}@@ -892,7 +879,7 @@ mod tests {fn corrects_medication_effect_him() {assert_suggestion_result("The medication didn't effect him the way the doctor expected.",- NounVerbConfusion::default(),+ test_linter(),"The medication didn't affect him the way the doctor expected.",);}@@ -901,7 +888,7 @@ mod tests {fn corrects_payments_effect_credit() {assert_suggestion_result("Late payments will negatively effect your credit score.",- NounVerbConfusion::default(),+ test_linter(),"Late payments will negatively affect your credit score.",);}@@ -910,7 +897,7 @@ mod tests {fn corrects_wording_effect_interpretation() {assert_suggestion_result("Minor wording tweaks shouldn't effect the legal interpretation.",- NounVerbConfusion::default(),+ test_linter(),"Minor wording tweaks shouldn't affect the legal interpretation.",);}@@ -919,7 +906,7 @@ mod tests {fn corrects_traffic_effect_delivery() {assert_suggestion_result("Traffic patterns often effect delivery windows downtown.",- NounVerbConfusion::default(),+ test_linter(),"Traffic patterns often affect delivery windows downtown.",);}@@ -928,7 +915,7 @@ mod tests {fn corrects_rumor_effect_confidence() {assert_suggestion_result("The rumor started to effect investor confidence by noon.",- NounVerbConfusion::default(),+ test_linter(),"The rumor started to affect investor confidence by noon.",);}@@ -937,7 +924,7 @@ mod tests {fn corrects_allergies_effect_productivity() {assert_suggestion_result("Seasonal allergies badly effect her productivity each April.",- NounVerbConfusion::default(),+ test_linter(),"Seasonal allergies badly affect her productivity each April.",);}@@ -946,7 +933,7 @@ mod tests {fn corrects_feedback_effect_roadmap() {assert_suggestion_result("Your feedback won't immediately effect the roadmap.",- NounVerbConfusion::default(),+ test_linter(),"Your feedback won't immediately affect the roadmap.",);}@@ -955,7 +942,7 @@ mod tests {fn corrects_rules_effect_honeypot() {assert_suggestion_result("I cant seem to get my additional rules to effect the honeypot",- NounVerbConfusion::default(),+ test_linter(),"I cant seem to get my additional rules to affect the honeypot",);}@@ -964,7 +951,7 @@ mod tests {fn corrects_bandwidth_effect_video() {assert_suggestion_result("Fluctuating bandwidth can effect video call quality.",- NounVerbConfusion::default(),+ test_linter(),"Fluctuating bandwidth can affect video call quality.",);}@@ -973,7 +960,7 @@ mod tests {fn corrects_gradient_effect_sensor() {assert_suggestion_result("The temperature gradient might effect the sensor's calibration.",- NounVerbConfusion::default(),+ test_linter(),"The temperature gradient might affect the sensor's calibration.",);}@@ -982,7 +969,7 @@ mod tests {fn corrects_delays_effect_satisfaction() {assert_suggestion_result("Even tiny delays can effect user satisfaction metrics.",- NounVerbConfusion::default(),+ test_linter(),"Even tiny delays can affect user satisfaction metrics.",);}@@ -991,7 +978,7 @@ mod tests {fn corrects_architecture_effect_gps() {assert_suggestion_result("The surrounding architecture can effect GPS accuracy.",- NounVerbConfusion::default(),+ test_linter(),"The surrounding architecture can affect GPS accuracy.",);}@@ -1000,7 +987,7 @@ mod tests {fn corrects_lighting_effect_color() {assert_suggestion_result("Lighting conditions strongly effect color perception.",- NounVerbConfusion::default(),+ test_linter(),"Lighting conditions strongly affect color perception.",);}@@ -1009,7 +996,7 @@ mod tests {fn corrects_coach_effect_roles() {assert_suggestion_result("The new coach's strategy will effect players' roles.",- NounVerbConfusion::default(),+ test_linter(),"The new coach's strategy will affect players' roles.",);}@@ -1018,7 +1005,7 @@ mod tests {fn corrects_overtraining_effect_reaction() {assert_suggestion_result("Overtraining can effect reaction time and coordination.",- NounVerbConfusion::default(),+ test_linter(),"Overtraining can affect reaction time and coordination.",);}@@ -1027,7 +1014,7 @@ mod tests {fn corrects_label_effect_behavior() {assert_suggestion_result("The warning label may effect how consumers use the product.",- NounVerbConfusion::default(),+ test_linter(),"The warning label may affect how consumers use the product.",);}@@ -1037,25 +1024,21 @@ mod tests {fn corrects_because_affect_is() {assert_suggestion_result("I worry because affect is hidden.",- NounVerbConfusion::default(),+ test_linter(),"I worry because effect is hidden.",);}#[test]fn ignores_psychology_usage() {- assert_lint_count(- "The patient's affect is flat.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("The patient's affect is flat.", test_linter(), 0);}#[test]fn corrects_positive_affect_on() {assert_suggestion_result("The new law had a positive affect on small businesses.",- NounVerbConfusion::default(),+ test_linter(),"The new law had a positive effect on small businesses.",);}@@ -1064,7 +1047,7 @@ mod tests {fn corrects_great_affect() {assert_suggestion_result("badges that they provide to users to allow them to promote their projects to great affect",- NounVerbConfusion::default(),+ test_linter(),"badges that they provide to users to allow them to promote their projects to great effect",);}@@ -1073,7 +1056,7 @@ mod tests {fn corrects_affect_of() {assert_suggestion_result("We measured the affect of caffeine on reaction time.",- NounVerbConfusion::default(),+ test_linter(),"We measured the effect of caffeine on reaction time.",);}@@ -1082,7 +1065,7 @@ mod tests {fn corrects_side_affects() {assert_suggestion_result("The side affects included nausea and fatigue.",- NounVerbConfusion::default(),+ test_linter(),"The side effects included nausea and fatigue.",);}@@ -1091,7 +1074,7 @@ mod tests {fn no_change_side_effect() {assert_lint_count("I forgot to test the side effect that users are deleted when clearing data.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -1100,7 +1083,7 @@ mod tests {fn corrects_cause_and_affect() {assert_suggestion_result("Cause and affect are not the same thing.",- NounVerbConfusion::default(),+ test_linter(),"Cause and effect are not the same thing.",);}@@ -1109,7 +1092,7 @@ mod tests {fn corrects_have_an_affect_on() {assert_suggestion_result("The change will have an affect on our revenue.",- NounVerbConfusion::default(),+ test_linter(),"The change will have an effect on our revenue.",);}@@ -1118,7 +1101,7 @@ mod tests {fn corrects_took_affect() {assert_suggestion_result("The medicine took affect within minutes.",- NounVerbConfusion::default(),+ test_linter(),"The medicine took effect within minutes.",);}@@ -1127,7 +1110,7 @@ mod tests {fn corrects_come_into_affect() {assert_suggestion_result("The policy will come into affect on October 1.",- NounVerbConfusion::default(),+ test_linter(),"The policy will come into effect on October 1.",);}@@ -1136,7 +1119,7 @@ mod tests {fn corrects_in_affect_sentence() {assert_suggestion_result("The rules are now in affect.",- NounVerbConfusion::default(),+ test_linter(),"The rules are now in effect.",);}@@ -1145,7 +1128,7 @@ mod tests {fn corrects_with_immediate_affect() {assert_suggestion_result("With immediate affect, the office is closed.",- NounVerbConfusion::default(),+ test_linter(),"With immediate effect, the office is closed.",);}@@ -1154,7 +1137,7 @@ mod tests {fn corrects_special_affects() {assert_suggestion_result("The director used stunning special affects.",- NounVerbConfusion::default(),+ test_linter(),"The director used stunning special effects.",);}@@ -1163,7 +1146,7 @@ mod tests {fn corrects_placebo_affect() {assert_suggestion_result("The placebo affect can be powerful.",- NounVerbConfusion::default(),+ test_linter(),"The placebo effect can be powerful.",);}@@ -1172,7 +1155,7 @@ mod tests {fn corrects_ripple_affect() {assert_suggestion_result("We felt the ripple affect across the entire market.",- NounVerbConfusion::default(),+ test_linter(),"We felt the ripple effect across the entire market.",);}@@ -1181,7 +1164,7 @@ mod tests {fn corrects_snowball_affect() {assert_suggestion_result("The snowball affect amplified the problem.",- NounVerbConfusion::default(),+ test_linter(),"The snowball effect amplified the problem.",);}@@ -1190,7 +1173,7 @@ mod tests {fn corrects_knock_on_affect() {assert_suggestion_result("That decision had a knock-on affect throughout the team.",- NounVerbConfusion::default(),+ test_linter(),"That decision had a knock-on effect throughout the team.",);}@@ -1199,7 +1182,7 @@ mod tests {fn corrects_greenhouse_affect() {assert_suggestion_result("The greenhouse affect warms the planet.",- NounVerbConfusion::default(),+ test_linter(),"The greenhouse effect warms the planet.",);}@@ -1208,7 +1191,7 @@ mod tests {fn corrects_little_affect() {assert_suggestion_result("Her apology had little affect.",- NounVerbConfusion::default(),+ test_linter(),"Her apology had little effect.",);}@@ -1217,7 +1200,7 @@ mod tests {fn corrects_go_into_affect() {assert_suggestion_result("The new settings go into affect after a restart.",- NounVerbConfusion::default(),+ test_linter(),"The new settings go into effect after a restart.",);}@@ -1226,7 +1209,7 @@ mod tests {fn corrects_put_plan_into_affect() {assert_suggestion_result("They put the new plan into affect last week.",- NounVerbConfusion::default(),+ test_linter(),"They put the new plan into effect last week.",);}@@ -1235,7 +1218,7 @@ mod tests {fn corrects_contract_into_affect() {assert_suggestion_result("The contract comes into affect at midnight.",- NounVerbConfusion::default(),+ test_linter(),"The contract comes into effect at midnight.",);}@@ -1244,7 +1227,7 @@ mod tests {fn corrects_no_affect_on_behavior() {assert_suggestion_result("The warning had no affect on his behavior.",- NounVerbConfusion::default(),+ test_linter(),"The warning had no effect on his behavior.",);}@@ -1253,7 +1236,7 @@ mod tests {fn corrects_opposite_affect() {assert_suggestion_result("Inflation had the opposite affect than expected.",- NounVerbConfusion::default(),+ test_linter(),"Inflation had the opposite effect than expected.",);}@@ -1262,7 +1245,7 @@ mod tests {fn corrects_remains_in_affect() {assert_suggestion_result("The regulation remains in affect until further notice.",- NounVerbConfusion::default(),+ test_linter(),"The regulation remains in effect until further notice.",);}@@ -1271,7 +1254,7 @@ mod tests {fn corrects_take_affect_next_week() {assert_suggestion_result("The app changes take affect next week.",- NounVerbConfusion::default(),+ test_linter(),"The app changes take effect next week.",);}@@ -1280,7 +1263,7 @@ mod tests {fn corrects_sound_affects() {assert_suggestion_result("Sound affects were added in post.",- NounVerbConfusion::default(),+ test_linter(),"Sound effects were added in post.",);}@@ -1289,7 +1272,7 @@ mod tests {fn does_not_flag_best_affect() {assert_lint_count("Using linear regression to predict and understand what factors best affect house price",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -1298,7 +1281,7 @@ mod tests {fn does_not_flag_sound_affect() {assert_lint_count("The goal of this study was to learn what properties of sound affect human focus the most.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -1307,7 +1290,7 @@ mod tests {fn corrects_sound_affect() {assert_suggestion_result("Diesel Generator's animation returns to 'idle' state, but it's sound affect remains in the 'work' state.",- NounVerbConfusion::default(),+ test_linter(),"Diesel Generator's animation returns to 'idle' state, but it's sound effect remains in the 'work' state.",);}@@ -1316,7 +1299,7 @@ mod tests {fn does_not_flag_affect_as_verb() {assert_lint_count("The change will affect our revenue significantly.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -1325,50 +1308,39 @@ mod tests {fn does_not_flag_affects_as_verb() {assert_lint_count("This policy directly affects remote workers.",- NounVerbConfusion::default(),+ test_linter(),0,);}#[test]fn does_not_flag_correct_effect_noun() {- assert_lint_count(- "The placebo effect can be powerful.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("The placebo effect can be powerful.", test_linter(), 0);}#[test]fn does_not_flag_sound_effects() {- assert_lint_count(- "Sound effects were added in post.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("Sound effects were added in post.", test_linter(), 0);}#[test]fn issue_1997() {assert_no_lints("It depends on which sources it affects, what parameters it uses, etc.",- NounVerbConfusion::default(),+ test_linter(),);}#[test]fn issue_1996() {- assert_no_lints(- "Avoid effects outside of functions.",- NounVerbConfusion::default(),- );+ assert_no_lints("Avoid effects outside of functions.", test_linter());}#[test]fn issue_2008() {assert_no_lints("Changes that only affect static types, without breaking runtime behavior.",- NounVerbConfusion::default(),+ test_linter(),);}@@ -1376,7 +1348,7 @@ mod tests {fn issue_2041() {assert_suggestion_result("Let me give you a piece of advise.",- NounVerbConfusion::default(),+ test_linter(),"Let me give you a piece of advice.",);}@@ -1385,7 +1357,7 @@ mod tests {fn fix_helps_you_weight() {assert_suggestion_result("An iOS app that helps you weight small things on the screen of your iPhone / iPad.",- NounVerbConfusion::default(),+ test_linter(),"An iOS app that helps you weigh small things on the screen of your iPhone / iPad.",);}@@ -1394,7 +1366,7 @@ mod tests {fn fix_do_you_weight() {assert_suggestion_result("How much do you weight?",- NounVerbConfusion::default(),+ test_linter(),"How much do you weigh?",);}@@ -1403,7 +1375,7 @@ mod tests {fn fix_more_than_you_weight() {assert_suggestion_result("contributed more than you weight",- NounVerbConfusion::default(),+ test_linter(),"contributed more than you weigh",);}@@ -1415,27 +1387,19 @@ mod tests {fn no_flag_side_effects_from_medication() {assert_lint_count("There were no side effects from the medication.",- NounVerbConfusion::default(),+ test_linter(),0,);}#[test]fn no_flag_side_effects_in_functions() {- assert_lint_count(- "Avoid side effects in your functions.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("Avoid side effects in your functions.", test_linter(), 0);}#[test]fn no_flag_this_change_has_no_side_effects() {- assert_lint_count(- "This change has no side effects.",- NounVerbConfusion::default(),- 0,- );+ assert_lint_count("This change has no side effects.", test_linter(), 0);}#[test]@@ -1443,7 +1407,7 @@ mod tests {// "side" is the subject, "affects" is the verb — legitimate usage.assert_lint_count("I am still not clear how padding side affects the results.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -1453,7 +1417,7 @@ mod tests {// "side" is part of the noun phrase "what side", "affects" is the verb.assert_lint_count("Move that to the top level so you don't need to worry about what side affects the import machinery.",- NounVerbConfusion::default(),+ test_linter(),0,);}@@ -1463,7 +1427,7 @@ mod tests {// "side" is part of the noun phrase "script side", "affect" is the verb.assert_lint_count("Would an unfreed reference in the script side affect the other side somehow?",- NounVerbConfusion::default(),+ test_linter(),0,);}diff --git a/harper-core/src/linting/open_compounds.rs b/harper-core/src/linting/open_compounds.rsindex 19cb3bfb3..02dadf387 100644--- a/harper-core/src/linting/open_compounds.rs+++ b/harper-core/src/linting/open_compounds.rs@@ -151,15 +151,18 @@ fn get_compound_idx(toks: &[Token], src: &[char], compound: &str) -> Option<usiz#[cfg(test)]mod tests {use super::OpenCompounds;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_suggestion_result};+ create_test_pool!(OpenCompounds, OpenCompounds, OpenCompounds::default());+// In front#[test]fn corrects_lone_infront() {assert_suggestion_result("Button always overlaps (infront) of other views.",- OpenCompounds::default(),+ test_linter(),"Button always overlaps (in front) of other views.",);}@@ -168,7 +171,7 @@ mod tests {fn corrects_infront() {assert_suggestion_result("So if i have no variable or a running process id/name which indicates that liveley is infront/fullscreen i can't do anything further via batch and must wait ...",- OpenCompounds::default(),+ test_linter(),"So if i have no variable or a running process id/name which indicates that liveley is in front/fullscreen i can't do anything further via batch and must wait ...",);}@@ -177,7 +180,7 @@ mod tests {fn ignores_pascalcase() {assert_lint_count("InFront Labs, LLC has 16 repositories available. Follow their code on GitHub.",- OpenCompounds::default(),+ test_linter(),0,);}@@ -186,7 +189,7 @@ mod tests {fn ignores_camelcase() {assert_lint_count("Click the \"toggle\" button to see how wrapping changes when an inFront is added to a letter in a word.",- OpenCompounds::default(),+ test_linter(),0,);}@@ -195,26 +198,26 @@ mod tests {fn correct_with_period_after() {assert_suggestion_result("Car with a reversed ramp infront.",- OpenCompounds::default(),+ test_linter(),"Car with a reversed ramp in front.",);}#[test]fn ignore_hyphen_before() {- assert_lint_count("-infront", OpenCompounds::default(), 0);+ assert_lint_count("-infront", test_linter(), 0);}#[test]fn ignore_hyphen_after() {- assert_lint_count("infront-", OpenCompounds::default(), 0);+ assert_lint_count("infront-", test_linter(), 0);}#[test]fn ignores_with_hyphen_before() {assert_lint_count("Instantly share code, notes, and snippets. @yossi-infront",- OpenCompounds::default(),+ test_linter(),0,);}@@ -223,18 +226,14 @@ mod tests {fn ignores_with_hyphen_after() {assert_lint_count("infront-cycle.ipe · infront-cycle.ipe · infront-cycle.svg · infront-cycle.svg · infront-s1s2.ipe · infront-s1s2.ipe · infront-s1s2.svg · infront-s1s2.svg.",- OpenCompounds::default(),+ test_linter(),0,);}#[test]fn even_repeated_infront_works() {- assert_suggestion_result(- "infront infront",- OpenCompounds::default(),- "in front in front",- );+ assert_suggestion_result("infront infront", test_linter(), "in front in front");}// A few@@ -243,7 +242,7 @@ mod tests {fn correct_afew_atomic() {assert_suggestion_result("ITK code to generate anisotropic metrics, mostly Riemannian metrics and afew particular cases of Finslerian metrics.",- OpenCompounds::default(),+ test_linter(),"ITK code to generate anisotropic metrics, mostly Riemannian metrics and a few particular cases of Finslerian metrics.",);}@@ -252,21 +251,21 @@ mod tests {#[test]fn correct_alot_atomic() {- assert_suggestion_result("Alot", OpenCompounds::default(), "A lot");+ assert_suggestion_result("Alot", test_linter(), "A lot");}// As well#[test]fn correct_aswell_atomic() {- assert_suggestion_result("Aswell", OpenCompounds::default(), "As well");+ assert_suggestion_result("Aswell", test_linter(), "As well");}#[test]fn corrects_as_keyboards_aswell() {assert_suggestion_result("Tool to read physical joystick devices, keyboards aswell, and create virtual joystick devices and output keyboard presses on a Linux system.",- OpenCompounds::default(),+ test_linter(),"Tool to read physical joystick devices, keyboards as well, and create virtual joystick devices and output keyboard presses on a Linux system.",);}@@ -275,7 +274,7 @@ mod tests {fn corrects_aswell_as() {assert_suggestion_result("When UseAcrylic is true in Focused aswell as Unfocused Apearance , changing enableUnfocusedAcrylic at runtime doesn't work",- OpenCompounds::default(),+ test_linter(),"When UseAcrylic is true in Focused as well as Unfocused Apearance , changing enableUnfocusedAcrylic at runtime doesn't work",);}@@ -284,7 +283,7 @@ mod tests {fn corrects_toml_aswell() {assert_suggestion_result("format Cargo.toml aswell #5893 - rust-lang/rustfmt",- OpenCompounds::default(),+ test_linter(),"format Cargo.toml as well #5893 - rust-lang/rustfmt",);}@@ -293,7 +292,7 @@ mod tests {fn correct_aswell() {assert_suggestion_result("'wejoy' is a tool to read physical joystick devices, aswell as keyboards, create virtual joystick devices and output keyboard presses on a Linux system.",- OpenCompounds::default(),+ test_linter(),"'wejoy' is a tool to read physical joystick devices, as well as keyboards, create virtual joystick devices and output keyboard presses on a Linux system.",);}@@ -304,7 +303,7 @@ mod tests {fn correct_atall() {assert_suggestion_result("claude code with vs code extension not working atall",- OpenCompounds::default(),+ test_linter(),"claude code with vs code extension not working at all",);}@@ -313,14 +312,14 @@ mod tests {#[test]fn correct_atleast_atomic() {- assert_suggestion_result("Atleast", OpenCompounds::default(), "At least");+ assert_suggestion_result("Atleast", test_linter(), "At least");}#[test]fn ignore_atleast_pascalcase() {assert_lint_count("I want to understand if we are using AtLeast correctly.",- OpenCompounds::default(),+ test_linter(),0,);}@@ -329,7 +328,7 @@ mod tests {fn ignore_atleast_camelcase() {assert_lint_count("verfiy with atLeast = 0 should pass even if the mocked function is never called.",- OpenCompounds::default(),+ test_linter(),0,);}@@ -338,7 +337,7 @@ mod tests {fn correct_atleast() {assert_suggestion_result("Mar 22, 2562 BE — constructor - expected atleast one input #250.",- OpenCompounds::default(),+ test_linter(),"Mar 22, 2562 BE — constructor - expected at least one input #250.",);}@@ -347,14 +346,14 @@ mod tests {#[test]fn correct_eachother_atomic() {- assert_suggestion_result("Eachother", OpenCompounds::default(), "Each other");+ assert_suggestion_result("Eachother", test_linter(), "Each other");}#[test]fn correct_eachother() {assert_suggestion_result("Script parsing fails when two scenes reference eachother",- OpenCompounds::default(),+ test_linter(),"Script parsing fails when two scenes reference each other",);}@@ -363,14 +362,14 @@ mod tests {#[test]fn correct_incase_atomic() {- assert_suggestion_result("Incase", OpenCompounds::default(), "In case");+ assert_suggestion_result("Incase", test_linter(), "In case");}#[test]fn correct_in_case() {assert_suggestion_result("Support for enum variable incase of reusable enum class",- OpenCompounds::default(),+ test_linter(),"Support for enum variable in case of reusable enum class",);}@@ -379,7 +378,7 @@ mod tests {fn ignore_incase_pascalcase() {assert_lint_count("InCase save your secrets for a friend, so they can use in case it in case you went \"missing\".",- OpenCompounds::default(),+ test_linter(),0,);}@@ -390,7 +389,7 @@ mod tests {fn correct_infact_atomic() {assert_suggestion_result("Yes I do infact exist :O",- OpenCompounds::default(),+ test_linter(),"Yes I do in fact exist :O",);}@@ -401,7 +400,7 @@ mod tests {fn correct_upto() {assert_suggestion_result("Free for upto 10k subscribers, unlimited push notifications, in-browser messaging",- OpenCompounds::default(),+ test_linter(),"Free for up to 10k subscribers, unlimited push notifications, in-browser messaging",);}diff --git a/harper-core/src/linting/phrasal_verb_as_compound_noun.rs b/harper-core/src/linting/phrasal_verb_as_compound_noun.rsindex 1059744fd..4a8054c1b 100644--- a/harper-core/src/linting/phrasal_verb_as_compound_noun.rs+++ b/harper-core/src/linting/phrasal_verb_as_compound_noun.rs@@ -332,6 +332,13 @@ fn is_part_of_noun_list(document: &Document, current_index: usize) -> bool {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(+ PhrasalVerbAsCompoundNoun,+ PhrasalVerbAsCompoundNoun,+ PhrasalVerbAsCompoundNoun::default()+ );use super::PhrasalVerbAsCompoundNoun;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};@@ -339,7 +346,7 @@ mod tests {fn flag_breakup_and_workout() {assert_lint_count("I will never breakup with Gym. We just seem to workout.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),2,);}@@ -348,7 +355,7 @@ mod tests {fn correct_breakup_and_workout() {assert_suggestion_result("I will never breakup with Gym. We just seem to workout.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),"I will never break up with Gym. We just seem to work out.",);}@@ -386,93 +393,73 @@ mod tests {#[test]fn dont_flag_random_words_that_happen_to_end_like_a_particle() {- assert_no_lints("I like bacon.", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("I like bacon.", test_linter());}#[test]fn dont_flag_non_verb_particles() {- assert_no_lints("non", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("non", test_linter());}#[test]fn correct_after_i() {- assert_suggestion_result(- "I backup",- PhrasalVerbAsCompoundNoun::default(),- "I back up",- );+ assert_suggestion_result("I backup", test_linter(), "I back up");}#[test]fn correct_after_we() {- assert_suggestion_result(- "we breakup",- PhrasalVerbAsCompoundNoun::default(),- "we break up",- );+ assert_suggestion_result("we breakup", test_linter(), "we break up");}#[test]fn dont_flag_checkin() {// It's actually not a noun in English.- assert_no_lints("checkin", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("checkin", test_linter());}#[test]fn dont_flag_cleanup() {- assert_no_lints("cleanup", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("cleanup", test_linter());}#[test]fn correct_after_you_lowercase() {- assert_suggestion_result(- "you checkout",- PhrasalVerbAsCompoundNoun::default(),- "you check out",- );+ assert_suggestion_result("you checkout", test_linter(), "you check out");}#[test]fn correct_after_you_capitalized() {- assert_suggestion_result(- "You checkout",- PhrasalVerbAsCompoundNoun::default(),- "You check out",- );+ assert_suggestion_result("You checkout", test_linter(), "You check out");}#[test]fn flag_checkout_after_you() {- assert_lint_count("you checkout", PhrasalVerbAsCompoundNoun::default(), 1);+ assert_lint_count("you checkout", test_linter(), 1);}#[test]fn correct_after_they_lowercase() {- assert_suggestion_result(- "they cleanup",- PhrasalVerbAsCompoundNoun::default(),- "they clean up",- );+ assert_suggestion_result("they cleanup", test_linter(), "they clean up");}#[test]fn flag_cleanup_after_they() {- assert_lint_count("they cleanup", PhrasalVerbAsCompoundNoun::default(), 1);+ assert_lint_count("they cleanup", test_linter(), 1);}#[test]fn dont_flag_dictionary_lookup() {- assert_no_lints("dictionary lookup", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("dictionary lookup", test_linter());}#[test]fn flag_couples_breakup() {- assert_lint_count("couples breakup", PhrasalVerbAsCompoundNoun::default(), 1);+ assert_lint_count("couples breakup", test_linter(), 1);}#[test]fn dont_flag_gallon() {- assert_no_lints("gallon", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("gallon", test_linter());}// Maybe this works by accident because "given" is also an adjective.@@ -482,85 +469,64 @@ mod tests {fn dont_flag_startup_funding() {assert_no_lints("Yarvin has actually given startup funding. They hang out and party together",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_huge_markup() {- assert_no_lints(- "Sell it back to Russia at a huge markup.",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("Sell it back to Russia at a huge markup.", test_linter());}#[test]fn dont_flag_another_layoff() {- assert_no_lints(- "And now just announced another layoff",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("And now just announced another layoff", test_linter());}#[test]#[ignore = "\"Shakedown\" is a compound noun -- it's part of a comma-separated list with another noun \"threat\"\nBut this is not easy to check for so is not implemented yet."]fn dont_flag_a_threat_or_shakedown() {- assert_no_lints(- "Just a threat or Shakedown.",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("Just a threat or Shakedown.", test_linter());}#[test]fn dont_flag_a_flyover() {- assert_no_lints(- "if I'm the Brits I'm doing a flyover",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("if I'm the Brits I'm doing a flyover", test_linter());}#[test]fn dont_flag_mafia_style_shakedown() {assert_no_lints("Basically it's kind of a mafia style shakedown of Ukraine",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_my_meetup_repository() {- assert_no_lints(- "I might have in my Meetup repository",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("I might have in my Meetup repository", test_linter());}#[test]fn ignore_multi_word() {- assert_no_lints("I like this add-on!", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("I like this add-on!", test_linter());}#[test]fn dont_flag_list_of_nouns_1298() {- assert_no_lints(- "A printable format and layout.",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("A printable format and layout.", test_linter());}#[test]fn dont_flag_oov_nvim_plugin_1280() {- assert_no_lints(- "This is the nvim plugin for you.",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("This is the nvim plugin for you.", test_linter());}#[test]fn flag_title_case() {assert_lint_count("I Will Never Breakup With Gym. We Just Seem To Workout.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),2,);}@@ -569,7 +535,7 @@ mod tests {fn flag_all_caps() {assert_lint_count("I WILL NEVER BREAKUP WITH GYM. WE JUST SEEM TO WORKOUT.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),2,);}@@ -578,7 +544,7 @@ mod tests {fn false_positive_issue_1495() {assert_no_lints("Color schemes are available by using the Style Settings plugin.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -586,7 +552,7 @@ mod tests {fn dont_flag_thanks_a_lot_linter_description() {assert_lint_count("Thanks a lot` is the fixed, widely accepted form, while variants like `thanks lot` or `thanks alot` are non-standard and can jar readers.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),0,);}@@ -595,7 +561,7 @@ mod tests {fn dont_flag_backup_location() {assert_no_lints("Backup location: `%APPDATA%\\Cursor\\User\\globalStorage\\backups`",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -603,7 +569,7 @@ mod tests {fn dont_flag_backup_plan() {assert_no_lints("Every backup plan is unique, based on your risk assessment.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -611,7 +577,7 @@ mod tests {fn dont_flag_backup_program() {assert_no_lints("restic is a backup program that is fast, efficient and secure",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -619,7 +585,7 @@ mod tests {fn dont_flag_backup_solution_or_backup_problems() {assert_no_lints("NPBackup is a multiparadigm backup solution which tries to solve two major backup problems",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -627,7 +593,7 @@ mod tests {fn dont_flag_backup_utilities_backup_system_or_backup_snapshots() {assert_no_lints("GitHub Enterprise Server Backup Utilities is a backup system you install on a separate host, which takes backup snapshots",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -635,7 +601,7 @@ mod tests {fn dont_flag_backup_images() {assert_no_lints("This App creates and stores backup images of your Nextcloud.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -643,7 +609,7 @@ mod tests {fn fix_backup_individual_apps() {assert_suggestion_result("It requires root and allows you to backup individual apps and their data.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),"It requires root and allows you to back up individual apps and their data.",);}@@ -652,20 +618,20 @@ mod tests {fn dont_flag_backup_strategy() {assert_no_lints("This is for you if you want to quickly set up a backup strategy without much fuss.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_helm_backup_plugin() {- assert_no_lints("Helm Backup Plugin.", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("Helm Backup Plugin.", test_linter());}#[test]fn dont_flag_callback_function() {assert_no_lints("By the time the `setTimeout` callback function was invoked",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -673,33 +639,30 @@ mod tests {fn dont_flag_playback_latency() {assert_no_lints("Low-Latency HLS is a recently standardized variant of the protocol that allows to greatly reduce playback latency.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_workout_constraints() {- assert_no_lints("Workout constraints", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("Workout constraints", test_linter());}#[test]fn dont_flag_workout_preference() {- assert_no_lints("Workout preference", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("Workout preference", test_linter());}#[test]fn dont_flag_rollout_status() {- assert_no_lints(- "Rollout Status of Latest Image Release",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("Rollout Status of Latest Image Release", test_linter());}#[test]fn font_flag_with_plugin() {assert_no_lints("**Xcode** (8.0+, otherwise [with plugin](https://github.com/robertvojta/LigatureXcodePlugin))",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),)}@@ -707,23 +670,20 @@ mod tests {fn dont_flag_and_layout_of_data() {assert_no_lints("shape, memory space, and layout of data, while performing the complicated indexing for the user",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_in_noun_list_without_space_after_comma() {- assert_no_lints(- "shape, memory space,and layout of data",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("shape, memory space,and layout of data", test_linter());}#[test]fn dont_flag_layout_estimation() {assert_no_lints("Layout estimation focuses on predicting architectural elements, i.e., walls, doors, and windows, within an indoor scene.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -731,7 +691,7 @@ mod tests {fn dont_flag_plugin_that() {assert_no_lints("plugin that provides way for auto-loading of Golang SDK",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -739,23 +699,20 @@ mod tests {fn dont_flag_load_balancing_and_failover() {assert_no_lints("resilient mid-tier load balancing and failover",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_plugin_for() {- assert_no_lints(- "Plugin for text editors and IDEs.",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("Plugin for text editors and IDEs.", test_linter());}#[test]fn dont_flag_markup_language() {assert_no_lints("Markup language used for websites & web apps.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -763,7 +720,7 @@ mod tests {fn dont_flag_plugin_ecosystem_or_plugin_development() {assert_no_lints("## 🧩 Plugin Ecosystem\n### Plugin Development",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -771,23 +728,20 @@ mod tests {fn dont_flag_plugin_files_or_plugin_packages() {assert_no_lints("plugin files between plugin packages installed with pip must have unique filenames.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_plugin_docs() {- assert_no_lints(- "building your own plugin: [Plugin Docs]",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("building your own plugin: [Plugin Docs]", test_linter());}#[test]fn dont_flag_plugin_suite() {assert_no_lints("An all-in-one digital audio workstation (DAW) and plugin suite.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -795,52 +749,46 @@ mod tests {fn dont_flag_hacker_news_throwback_machine() {assert_no_lints("| Hacker News Throwback Machine | Shows what was popular on Hacker News on this day in previous years.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_plugin_interface() {- assert_no_lints("[Plugin interface]", PhrasalVerbAsCompoundNoun::default());+ assert_no_lints("[Plugin interface]", test_linter());}#[test]fn issue_1918() {assert_no_lints("Boost your productivity with our JetBrains plugin!",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn dont_flag_pop_up_2217() {- assert_no_lints(- "Popup window instead of command line.",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("Popup window instead of command line.", test_linter());}#[test]fn issue_1772() {assert_no_lints("By default, only one tile size is instantiated for each data type, math instruction, and layout.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}#[test]fn issue_2369() {- assert_no_lints(- "## Plugin developer documentation",- PhrasalVerbAsCompoundNoun::default(),- );+ assert_no_lints("## Plugin developer documentation", test_linter());}#[test]fn issue_2505_dont_flag_backup_links() {assert_no_lints("seamless switching to one of the backup links ideally happens without packet drops",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}@@ -848,7 +796,7 @@ mod tests {fn issue_2505_correct_setup_but_dont_flag_backup_link() {assert_suggestion_result("How to properly setup a backup link (and have it act like a backup again after stop/start of master link)",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),"How to properly set up a backup link (and have it act like a backup again after stop/start of master link)",);}@@ -857,7 +805,7 @@ mod tests {fn dont_flag_meltdown_3591() {assert_no_lints("Unfortunately, Meltdown ended up being problematic.",- PhrasalVerbAsCompoundNoun::default(),+ test_linter(),);}}diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rsindex 88fb60485..59acc4110 100644--- a/harper-core/src/linting/phrase_set_corrections/tests.rs+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs@@ -1,9 +1,14 @@+use super::LintGroup;+use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_good_and_bad_suggestions, assert_lint_count, assert_no_lints, assert_suggestion_result,};use super::lint_group;+// Use a global pool of lint groups to amortize construction costs.+create_test_pool!(LintGroup, LintGroup, lint_group());+/// Helper function to create a lint group with only a single rule enabled.fn single_lint(rule_name: &str) -> crate::linting::LintGroup {let mut group = lint_group();@@ -20,7 +25,7 @@ fn single_lint(rule_name: &str) -> crate::linting::LintGroup {fn corrects_further_ado() {assert_suggestion_result("... but we finally hit a great spot, so without further adieu.",- lint_group(),+ test_linter(),"... but we finally hit a great spot, so without further ado.",);}@@ -29,7 +34,7 @@ fn corrects_further_ado() {fn corrects_much_ado() {assert_suggestion_result("After much adieu this functionality is now available.",- lint_group(),+ test_linter(),"After much ado this functionality is now available.",);}@@ -40,7 +45,7 @@ fn corrects_much_ado() {fn corrects_theres_an_argument_to_be_said() {assert_suggestion_result("I guess there s an argument to be said that if the TUCKR_HOME is already defined, it should use that instead.",- lint_group(),+ test_linter(),"I guess there s an argument to be made that if the TUCKR_HOME is already defined, it should use that instead.",);}@@ -49,7 +54,7 @@ fn corrects_theres_an_argument_to_be_said() {fn corrects_there_is_an_argument_to_be_said() {assert_suggestion_result("Same argument for smooth_image_crate, although there is an argument to be said this is more-generally useful than scale_image_crate",- lint_group(),+ test_linter(),"Same argument for smooth_image_crate, although there is an argument to be made this is more-generally useful than scale_image_crate",);}@@ -58,7 +63,7 @@ fn corrects_there_is_an_argument_to_be_said() {fn corrects_theres_theres_arguments_to_be_said() {assert_suggestion_result("there's there's arguments to be said for all of it.",- lint_group(),+ test_linter(),"there's there's arguments to be made for all of it.",);}@@ -69,7 +74,7 @@ fn corrects_theres_theres_arguments_to_be_said() {fn fix_complete_bullocks() {assert_suggestion_result("why you think some of them are complete bullocks or would be a bad idea",- lint_group(),+ test_linter(),"why you think some of them are complete bollocks or would be a bad idea",);}@@ -78,7 +83,7 @@ fn fix_complete_bullocks() {fn fix_dogs() {assert_suggestion_result("The cat's ass, priceless! I have to steal that one. My go to phrase is “The dog's bullocks.",- lint_group(),+ test_linter(),"The cat's ass, priceless! I have to steal that one. My go to phrase is “The dog's bollocks.",);}@@ -87,7 +92,7 @@ fn fix_dogs() {fn fix_dogs_no_apostrophe_bullocks() {assert_suggestion_result("some dumb rubbish that i do not give a dogs bullocks about",- lint_group(),+ test_linter(),"some dumb rubbish that i do not give a dogs bollocks about",);}@@ -96,7 +101,7 @@ fn fix_dogs_no_apostrophe_bullocks() {fn fix_is_bullocks() {assert_suggestion_result("for me this is bullocks, when the same user can sudo rm -rf",- lint_group(),+ test_linter(),"for me this is bollocks, when the same user can sudo rm -rf",);}@@ -105,7 +110,7 @@ fn fix_is_bullocks() {fn fix_its_bullocks() {assert_suggestion_result("I'm too lazy to explain why, but I think it's bullocks.",- lint_group(),+ test_linter(),"I'm too lazy to explain why, but I think it's bollocks.",);}@@ -114,7 +119,7 @@ fn fix_its_bullocks() {fn fix_its_no_apostrophe_bullocks() {assert_suggestion_result("but lance, dont claim to be clean, because we all know its bullocks",- lint_group(),+ test_linter(),"but lance, dont claim to be clean, because we all know its bollocks",);}@@ -123,7 +128,7 @@ fn fix_its_no_apostrophe_bullocks() {fn fix_such_bullocks() {assert_suggestion_result("This is why numerology is such bullocks.",- lint_group(),+ test_linter(),"This is why numerology is such bollocks.",);}@@ -132,7 +137,7 @@ fn fix_such_bullocks() {fn fix_thats_bullocks() {assert_suggestion_result("Respectfully, that's bullocks.",- lint_group(),+ test_linter(),"Respectfully, that's bollocks.",);}@@ -141,7 +146,7 @@ fn fix_thats_bullocks() {fn fix_thats_no_apostrophe_bullocks() {assert_suggestion_result("In CSS thats bullocks as directives have priority in the order they are defined.",- lint_group(),+ test_linter(),"In CSS thats bollocks as directives have priority in the order they are defined.",);}@@ -150,7 +155,7 @@ fn fix_thats_no_apostrophe_bullocks() {fn fix_total_bullocks() {assert_suggestion_result("Pointing out to the audience that their gravity explanation is total bullocks would seem an ethical must as well.",- lint_group(),+ test_linter(),"Pointing out to the audience that their gravity explanation is total bollocks would seem an ethical must as well.",);}@@ -159,7 +164,7 @@ fn fix_total_bullocks() {fn fix_utter_bullocks() {assert_suggestion_result("what utter bullocks a self employed person will get £94 under corona virus crisis",- lint_group(),+ test_linter(),"what utter bollocks a self employed person will get £94 under corona virus crisis",);}@@ -168,7 +173,7 @@ fn fix_utter_bullocks() {fn fix_was_bullocks() {assert_suggestion_result("a few years ago I thought that was bullocks",- lint_group(),+ test_linter(),"a few years ago I thought that was bollocks",);}@@ -177,7 +182,7 @@ fn fix_was_bullocks() {fn fix_bullocks_exclamation() {assert_suggestion_result("throw(new Error('Bullocks!')));",- lint_group(),+ test_linter(),"throw(new Error('Bollocks!')));",);}@@ -186,7 +191,7 @@ fn fix_bullocks_exclamation() {fn dont_flag_herd_of_bullocks() {assert_no_lints("driven back (literally) by a herd of bullocks across the path",- lint_group(),+ test_linter(),);}@@ -195,7 +200,7 @@ fn dont_flag_herd_of_bullocks() {fn correct_chomp_at_the_bit() {assert_suggestion_result("so other than rolling back to older drivers i might have to chomp at the bit for a while longer yet",- lint_group(),+ test_linter(),"so other than rolling back to older drivers i might have to champ at the bit for a while longer yet",);}@@ -204,7 +209,7 @@ fn correct_chomp_at_the_bit() {fn correct_chomped_at_the_bit() {assert_suggestion_result("I chomped at the bit, frustrated by my urge to go faster, while my husband chafed at what I thought was a moderate pace.",- lint_group(),+ test_linter(),"I champed at the bit, frustrated by my urge to go faster, while my husband chafed at what I thought was a moderate pace.",);}@@ -213,7 +218,7 @@ fn correct_chomped_at_the_bit() {fn correct_chomping_at_the_bit() {assert_suggestion_result("Checking in to see when the Windows install will be ready. I am chomping at the bit!",- lint_group(),+ test_linter(),"Checking in to see when the Windows install will be ready. I am champing at the bit!",);}@@ -222,7 +227,7 @@ fn correct_chomping_at_the_bit() {fn correct_chomps_at_the_bit() {assert_suggestion_result("nobody chomps at the bit to make sure these are maintained, current, complete, and error free",- lint_group(),+ test_linter(),"nobody champs at the bit to make sure these are maintained, current, complete, and error free",);}@@ -234,7 +239,7 @@ fn correct_chomps_at_the_bit() {fn correct_clients_side() {assert_suggestion_result("I want to debug this server-side as I cannot find out why the connection is being refused from the client's side.",- lint_group(),+ test_linter(),"I want to debug this server-side as I cannot find out why the connection is being refused from the client-side.",);}@@ -244,7 +249,7 @@ fn correct_clients_side() {fn correct_servers_side() {assert_suggestion_result("A client-server model where the client can execute commands in a terminal on the server's side",- lint_group(),+ test_linter(),"A client-server model where the client can execute commands in a terminal on the server-side",);}@@ -255,7 +260,7 @@ fn correct_servers_side() {fn correct_compulse() {assert_suggestion_result("Play Store will soon compulse to use SDK 30 on any app updates , and it's mandatory to have SDK 30 for new apps.",- lint_group(),+ test_linter(),"Play Store will soon compel to use SDK 30 on any app updates , and it's mandatory to have SDK 30 for new apps.",);}@@ -264,7 +269,7 @@ fn correct_compulse() {fn correct_compulsed() {assert_suggestion_result("Just alpha, but now i am compulsed to work 10.6 into the github actions and insane docker environment :)",- lint_group(),+ test_linter(),"Just alpha, but now i am compelled to work 10.6 into the github actions and insane docker environment :)",);}@@ -273,7 +278,7 @@ fn correct_compulsed() {fn correct_compulses() {assert_suggestion_result("Occasionally, a film comes along that compulses me to make a fan poster.",- lint_group(),+ test_linter(),"Occasionally, a film comes along that compels me to make a fan poster.",);}@@ -282,7 +287,7 @@ fn correct_compulses() {fn correct_compulsing() {assert_suggestion_result("We have an button enabled to prompt user to download the app whenever we find difference in version number in our servlet war file and apk verision compulsing user to update.",- lint_group(),+ test_linter(),"We have an button enabled to prompt user to download the app whenever we find difference in version number in our servlet war file and apk verision compelling user to update.",);}@@ -293,7 +298,7 @@ fn correct_compulsing() {fn correct_conform_that() {assert_suggestion_result("the WCAG requires every view of the page to conform that we move this",- lint_group(),+ test_linter(),"the WCAG requires every view of the page to confirm that we move this",);}@@ -302,7 +307,7 @@ fn correct_conform_that() {fn corrects_conformed_that() {assert_suggestion_result("I have conformed that works now.",- lint_group(),+ test_linter(),"I have confirmed that works now.",);}@@ -311,7 +316,7 @@ fn corrects_conformed_that() {fn corrects_conforms_that() {assert_suggestion_result("I conformed that with the correct configuration, this is working correctly.",- lint_group(),+ test_linter(),"I confirmed that with the correct configuration, this is working correctly.",);}@@ -321,7 +326,7 @@ fn corrects_conforms_that() {fn dont_flag_conforming_that() {assert_lint_count("is there any example of a case that isn't fully conforming that is supported today?",- lint_group(),+ test_linter(),0,);}@@ -330,7 +335,7 @@ fn dont_flag_conforming_that() {fn corrects_conforming_that() {assert_suggestion_result("Thanks for conforming that this issue is fixed in the latest version.",- lint_group(),+ test_linter(),"Thanks for confirming that this issue is fixed in the latest version.",);}@@ -341,7 +346,7 @@ fn corrects_conforming_that() {fn corrects_constitute_as() {assert_suggestion_result("This doesn't really constitute as an implicit cast in the eyes of the system.",- lint_group(),+ test_linter(),"This doesn't really constitute an implicit cast in the eyes of the system.",);}@@ -350,7 +355,7 @@ fn corrects_constitute_as() {fn corrects_constituted_as() {assert_suggestion_result("We do not recommend setting the number of threads to more than 20, as that can be constituted as a denial of service attack which we are not responsible for.",- lint_group(),+ test_linter(),"We do not recommend setting the number of threads to more than 20, as that can be constituted a denial of service attack which we are not responsible for.",);}@@ -359,7 +364,7 @@ fn corrects_constituted_as() {fn corrects_constitutes_as() {assert_suggestion_result("Hello! I was just wondering what constitutes as a prompt in GitHub CoPilot that consumes premium request tokens.",- lint_group(),+ test_linter(),"Hello! I was just wondering what constitutes a prompt in GitHub CoPilot that consumes premium request tokens.",);}@@ -368,7 +373,7 @@ fn corrects_constitutes_as() {fn corrects_constituting_as_example() {assert_suggestion_result("This is the example constituting as hull-demo 's values.yaml",- lint_group(),+ test_linter(),"This is the example constituting hull-demo 's values.yaml",);}@@ -378,7 +383,7 @@ fn corrects_constituting_as_example() {fn ambiguous_constituting_as() {assert_suggestion_result("Note that spinning up a Client is a non-trivial operation, constituting as much as a millisecond of overhead.",- lint_group(),+ test_linter(),// Maybe this one was supposed to be "contributing"?"Note that spinning up a Client is a non-trivial operation, constituting as much as a millisecond of overhead.",);@@ -390,7 +395,7 @@ fn ambiguous_constituting_as() {fn corrects_definite_article() {assert_suggestion_result("As for format of outputs: the spec defines the field as using the singular definitive article \"the\"",- lint_group(),+ test_linter(),"As for format of outputs: the spec defines the field as using the singular definite article \"the\"",);}@@ -400,7 +405,7 @@ fn corrects_definite_article() {fn corrects_definite_articles_title_case() {assert_suggestion_result("01 Definitive Articles: De or Het. Before starting more complicated topics in Dutch grammar, you should be aware of the articles.",- lint_group(),+ test_linter(),"01 Definite Articles: De or Het. Before starting more complicated topics in Dutch grammar, you should be aware of the articles.",);}@@ -409,7 +414,7 @@ fn corrects_definite_articles_title_case() {fn corrects_definite_articles_lowercase() {assert_suggestion_result(".. definitive articles -та /-ta/ and -те /-te/ (postfixed in Bulgarian).",- lint_group(),+ test_linter(),".. definite articles -та /-ta/ and -те /-te/ (postfixed in Bulgarian).",);}@@ -420,7 +425,7 @@ fn corrects_definite_articles_lowercase() {fn dont_flag_digestive_track() {assert_suggestion_result("In infants less than a year old, because their digestive track is not finished developing yet",- lint_group(),+ test_linter(),"In infants less than a year old, because their digestive tract is not finished developing yet",);}@@ -429,7 +434,7 @@ fn dont_flag_digestive_track() {fn corrects_digestive_tracks() {assert_suggestion_result("The digestive tracks of mammals are complex and diverse, with each species having its own unique digestive system.",- lint_group(),+ test_linter(),"The digestive tracts of mammals are complex and diverse, with each species having its own unique digestive system.",);}@@ -444,7 +449,7 @@ fn corrects_digestive_tracks() {fn corrects_dose_not() {assert_suggestion_result("It dose not run windows ?",- lint_group(),+ test_linter(),"It does not run windows ?",);}@@ -455,7 +460,7 @@ fn corrects_dose_not() {fn corrects_dose_it() {assert_suggestion_result("dose it support zh_cn ?",- lint_group(),+ test_linter(),"does it support zh_cn ?",);}@@ -468,7 +473,7 @@ fn corrects_dose_it() {fn dont_flag_excessive_dose_it_might() {assert_lint_count("it should be noted that in an excessive dose it might have an opposite effect",- lint_group(),+ test_linter(),0,);}@@ -479,7 +484,7 @@ fn dont_flag_excessive_dose_it_might() {fn dont_flag_second_dose_it_is_not() {assert_lint_count("When the person receives a prescribed second dose it is not counted ttwice",- lint_group(),+ test_linter(),0,);}@@ -488,7 +493,7 @@ fn dont_flag_second_dose_it_is_not() {#[test]#[ignore = "would be a false positive in a naive implementation"]fn dont_flag_a_dose_it_was() {- assert_lint_count("At that small a dose it was pleasent.", lint_group(), 0);+ assert_lint_count("At that small a dose it was pleasent.", test_linter(), 0);}// I do not know (what dose) (it takes) to trip out, but I don't think I could stay awake to find out.@@ -497,7 +502,7 @@ fn dont_flag_a_dose_it_was() {fn dont_flag_what_dose_it_takes() {assert_lint_count("I do not know what dose it takes to trip out, but I don't think I could stay awake to find out.",- lint_group(),+ test_linter(),0,);}@@ -509,7 +514,7 @@ fn dont_flag_what_dose_it_takes() {fn dont_flag_to_dose_it() {assert_lint_count("And then I have to re-add the salts back to it to dose it back up to drinkable.",- lint_group(),+ test_linter(),0,);}@@ -519,7 +524,7 @@ fn dont_flag_to_dose_it() {fn dont_flag_dont_dose_it_too_high() {assert_lint_count("So my conclusion is: don't dose it too high or it actually is dangerous and not pleasant at all",- lint_group(),+ test_linter(),0,);}@@ -529,7 +534,7 @@ fn dont_flag_dont_dose_it_too_high() {fn dont_flag_to_dose_it_off() {assert_lint_count("the only solution the other hopefully-dominant-reasonable-adult-human mind can find, is to dose it off, hoping the drowsiness can keep the fear at bay",- lint_group(),+ test_linter(),0,);}@@ -539,7 +544,7 @@ fn dont_flag_to_dose_it_off() {fn corrects_he_does() {assert_suggestion_result("This validate each and every field of your from with nice dotted red color warring for the user, incase he dose some mistakes.",- lint_group(),+ test_linter(),"This validate each and every field of your from with nice dotted red color warring for the user, incase he does some mistakes.",);}@@ -548,7 +553,7 @@ fn corrects_he_does() {fn corrects_she_does() {assert_suggestion_result("we wont agree on everything she dose thats what a real person would feel like",- lint_group(),+ test_linter(),"we wont agree on everything she does thats what a real person would feel like",);}@@ -558,7 +563,7 @@ fn corrects_she_does() {fn corrects_it_dose() {assert_suggestion_result("it dose work without WEBP enabled",- lint_group(),+ test_linter(),"it does work without WEBP enabled",);}@@ -568,7 +573,7 @@ fn corrects_it_dose() {fn corrects_someone_dose() {assert_suggestion_result("Hopefully someone dose, I'm not good at C programing....",- lint_group(),+ test_linter(),"Hopefully someone does, I'm not good at C programing....",);}@@ -578,7 +583,7 @@ fn corrects_someone_dose() {fn corrects_how_dose() {assert_suggestion_result("How dose qsv-copy works?",- lint_group(),+ test_linter(),"How does qsv-copy works?",);}@@ -588,7 +593,7 @@ fn corrects_how_dose() {fn dont_fix_how_dose_false_positive() {assert_lint_count("Work in progress exploration of how dose modifications throughout a trial can also induce bias in the exposure-response relationships.",- lint_group(),+ test_linter(),0,);}@@ -597,7 +602,7 @@ fn dont_fix_how_dose_false_positive() {fn corrects_when_dose() {assert_suggestion_result("When dose reusebale variable sync between device? #2634",- lint_group(),+ test_linter(),"When does reusebale variable sync between device? #2634",);}@@ -607,7 +612,7 @@ fn corrects_when_dose() {fn dont_fix_when_dose_false_positive() {assert_lint_count("Should we remove the dose when dose has been applied",- lint_group(),+ test_linter(),0,);}@@ -616,7 +621,7 @@ fn dont_fix_when_dose_false_positive() {fn corrects_where_dose() {assert_suggestion_result("where dose the password store?",- lint_group(),+ test_linter(),"where does the password store?",);}@@ -626,7 +631,7 @@ fn corrects_where_dose() {fn dont_fix_where_dose_false_positive() {assert_lint_count("added some better error handling for the weird case where dose files have no dose...",- lint_group(),+ test_linter(),0,);}@@ -635,7 +640,7 @@ fn dont_fix_where_dose_false_positive() {fn corrects_who_dose() {assert_suggestion_result("Who dose knows the problem?",- lint_group(),+ test_linter(),"Who does knows the problem?",);}@@ -644,7 +649,7 @@ fn corrects_who_dose() {fn corrects_why_dose() {assert_suggestion_result("why dose the path is random ?",- lint_group(),+ test_linter(),"why does the path is random ?",);}@@ -657,7 +662,7 @@ fn corrects_why_dose() {fn corrects_algo() {assert_suggestion_result("Always glad when the algo feeds me a new dissident.",- lint_group(),+ test_linter(),"Always glad when the algorithm feeds me a new dissident.",);}@@ -666,7 +671,7 @@ fn corrects_algo() {fn corrects_algos() {assert_suggestion_result("I moved algos development to a private repository.",- lint_group(),+ test_linter(),"I moved algorithms development to a private repository.",);}@@ -677,7 +682,7 @@ fn corrects_algos() {fn corrects_arg() {assert_suggestion_result("but I cannot figure out how to flag an arg as required",- lint_group(),+ test_linter(),"but I cannot figure out how to flag an argument as required",);}@@ -686,7 +691,7 @@ fn corrects_arg() {fn corrects_args() {assert_suggestion_result("but every test I've done shows args as being about 65% faster",- lint_group(),+ test_linter(),"but every test I've done shows arguments as being about 65% faster",);}@@ -697,7 +702,7 @@ fn corrects_args() {fn corrects_coord() {assert_suggestion_result("Prompted by #5684, we should probably emit more meaningful messages when position guides are specified in coord systems that do not support them",- lint_group(),+ test_linter(),"Prompted by #5684, we should probably emit more meaningful messages when position guides are specified in coordinate systems that do not support them",);}@@ -706,7 +711,7 @@ fn corrects_coord() {fn corrects_coords() {assert_suggestion_result("Here is how you can extract the list of coords from any geometry:",- lint_group(),+ test_linter(),"Here is how you can extract the list of coordinates from any geometry:",);}@@ -717,7 +722,7 @@ fn corrects_coords() {fn corrects_decl() {assert_suggestion_result("Yeah, I agree a forward decl would be preferable in this case.",- lint_group(),+ test_linter(),"Yeah, I agree a forward declaration would be preferable in this case.",);}@@ -726,7 +731,7 @@ fn corrects_decl() {fn corrects_decls() {assert_suggestion_result("Accessing type decls from pointer types",- lint_group(),+ test_linter(),"Accessing type declarations from pointer types",);}@@ -740,7 +745,7 @@ fn corrects_decls() {fn expand_deref() {assert_suggestion_result("Should raw pointer deref/projections have to be in-bounds?",- lint_group(),+ test_linter(),"Should raw pointer dereference/projections have to be in-bounds?",);}@@ -749,7 +754,7 @@ fn expand_deref() {fn corrects_derefs() {assert_suggestion_result("A contiguous-in-memory double-ended queue that derefs into a slice - gnzlbg/slice_deque.",- lint_group(),+ test_linter(),"A contiguous-in-memory double-ended queue that dereferences into a slice - gnzlbg/slice_deque.",);}@@ -760,7 +765,7 @@ fn corrects_derefs() {fn expands_dir() {assert_suggestion_result("Error: library dir does not exist: /Users/u/trr/node_modules/opencv",- lint_group(),+ test_linter(),"Error: library directory does not exist: /Users/u/trr/node_modules/opencv",);}@@ -769,7 +774,7 @@ fn expands_dir() {fn expands_dirs() {assert_suggestion_result("Dirs/files are missing when scanning on windows after 1.27.12",- lint_group(),+ test_linter(),"Directories/files are missing when scanning on windows after 1.27.12",);}@@ -780,7 +785,7 @@ fn expands_dirs() {fn corrects_notif() {assert_suggestion_result("Amazing to see the notif of this on my phone!",- lint_group(),+ test_linter(),"Amazing to see the notification of this on my phone!",);}@@ -789,7 +794,7 @@ fn corrects_notif() {fn corrects_notifs() {assert_suggestion_result("I don't encourage you spending all your time on social media or keeping the notifs on if you're working on something serious.",- lint_group(),+ test_linter(),"I don't encourage you spending all your time on social media or keeping the notifications on if you're working on something serious.",);}@@ -800,7 +805,7 @@ fn corrects_notifs() {fn corrects_param() {assert_suggestion_result("If I use the following to set an endDate param with a default value",- lint_group(),+ test_linter(),"If I use the following to set an endDate parameter with a default value",);}@@ -809,7 +814,7 @@ fn corrects_param() {fn corrects_params() {assert_suggestion_result("the params are not loaded in the R environment when using the terminal",- lint_group(),+ test_linter(),"the parameters are not loaded in the R environment when using the terminal",);}@@ -819,7 +824,7 @@ fn corrects_params() {fn correct_ptr() {assert_suggestion_result("How else would you construct a slice from a ptr and a length?",- lint_group(),+ test_linter(),"How else would you construct a slice from a pointer and a length?",);}@@ -827,7 +832,7 @@ fn correct_ptr() {fn correct_ptrs() {assert_suggestion_result("FixedBufferAllocator.free not freeing ptrs",- lint_group(),+ test_linter(),"FixedBufferAllocator.free not freeing pointers",);}@@ -846,7 +851,7 @@ fn correct_ptrs() {fn corrects_vuln() {assert_suggestion_result("I did not understand this vuln in first place now I do not understand in 2nd place as well😢",- lint_group(),+ test_linter(),"I did not understand this vulnerability in first place now I do not understand in 2nd place as well😢",);}@@ -862,7 +867,7 @@ fn corrects_vulns() {// Fix all lints in the `LintGroup`assert_suggestion_result("... when persisted, containing endpoints, vulns, WAF bypasses, sensitive params, and auth endpoints.",- lint_group(),+ test_linter(),"... when persisted, containing endpoints, vulnerabilities, WAF bypasses, sensitive parameters, and auth endpoints.",);}@@ -870,19 +875,19 @@ fn corrects_vulns() {// ExplanationMark#[test]fn detect_explanation_mark_atomic() {- assert_suggestion_result("explanation mark", lint_group(), "exclamation mark");+ assert_suggestion_result("explanation mark", test_linter(), "exclamation mark");}#[test]fn detect_explanation_marks_atomic() {- assert_suggestion_result("explanation marks", lint_group(), "exclamation marks");+ assert_suggestion_result("explanation marks", test_linter(), "exclamation marks");}#[test]fn detect_explanation_mark_real_world() {assert_suggestion_result("Note that circled explanation mark, question mark, plus and arrows may be significantly harder to distinguish than their uncircled variants.",- lint_group(),+ test_linter(),"Note that circled exclamation mark, question mark, plus and arrows may be significantly harder to distinguish than their uncircled variants.",);}@@ -891,21 +896,21 @@ fn detect_explanation_mark_real_world() {fn detect_explanation_marks_real_world() {assert_suggestion_result("this issue: html: properly handle explanation marks in comments",- lint_group(),+ test_linter(),"this issue: html: properly handle exclamation marks in comments",);}#[test]fn detect_explanation_point_atomic() {- assert_suggestion_result("explanation point", lint_group(), "exclamation point");+ assert_suggestion_result("explanation point", test_linter(), "exclamation point");}#[test]fn detect_explanation_point_real_world() {assert_suggestion_result("js and makes an offhand mention that you can disable inbuilt plugin with an explanation point (e.g. !error ).",- lint_group(),+ test_linter(),"js and makes an offhand mention that you can disable inbuilt plugin with an exclamation point (e.g. !error ).",);}@@ -916,7 +921,7 @@ fn detect_explanation_point_real_world() {fn correct_certain_extend() {assert_suggestion_result("This is a PowerShell script to automate client pentests / checkups - at least to a certain extend.",- lint_group(),+ test_linter(),"This is a PowerShell script to automate client pentests / checkups - at least to a certain extent.",);}@@ -925,7 +930,7 @@ fn correct_certain_extend() {fn correct_to_the_extend() {assert_suggestion_result("Our artifacts are carefully documented and well-structured to the extend that reuse is facilitated.",- lint_group(),+ test_linter(),"Our artifacts are carefully documented and well-structured to the extent that reuse is facilitated.",);}@@ -934,7 +939,7 @@ fn correct_to_the_extend() {fn correct_to_some_extend() {assert_suggestion_result("Hi, I'm new to Pydantic and to some extend python, and I have a question that I haven't been able to figure out from the Docs.",- lint_group(),+ test_linter(),"Hi, I'm new to Pydantic and to some extent python, and I have a question that I haven't been able to figure out from the Docs.",);}@@ -943,7 +948,7 @@ fn correct_to_some_extend() {fn correct_to_an_extend() {assert_suggestion_result("It mimics (to an extend) the way in which Chrome requests SSO cookies with the Windows 10 accounts extension.",- lint_group(),+ test_linter(),"It mimics (to an extent) the way in which Chrome requests SSO cookies with the Windows 10 accounts extension.",);}@@ -954,7 +959,7 @@ fn correct_to_an_extend() {fn corrects_flaunt_the_rules() {assert_suggestion_result("Some users flaunt the rules of punctuation.",- lint_group(),+ test_linter(),"Some users flout the rules of punctuation.",);}@@ -963,7 +968,7 @@ fn corrects_flaunt_the_rules() {fn corrects_flaunted_the_law() {assert_suggestion_result("He flaunted the law for personal gain.",- lint_group(),+ test_linter(),"He flouted the law for personal gain.",);}@@ -972,14 +977,14 @@ fn corrects_flaunted_the_law() {fn corrects_flaunting_authority() {assert_suggestion_result("She was flaunting authority at every turn.",- lint_group(),+ test_linter(),"She was flouting authority at every turn.",);}#[test]fn allows_flaunt_wealth() {- assert_no_lints("He likes to flaunt his wealth.", lint_group());+ assert_no_lints("He likes to flaunt his wealth.", test_linter());}// FoamAtTheMouth@@ -988,7 +993,7 @@ fn allows_flaunt_wealth() {fn correct_foam_out_the_mouth() {assert_suggestion_result("and he gave him a drink that made him foam out the mouth and die",- lint_group(),+ test_linter(),"and he gave him a drink that made him foam at the mouth and die",);}@@ -997,7 +1002,7 @@ fn correct_foam_out_the_mouth() {fn correct_foamed_out_the_mouth() {assert_suggestion_result("You can see in some shots they've foamed out the mouth, and it's apparent their poisoned.",- lint_group(),+ test_linter(),"You can see in some shots they've foamed at the mouth, and it's apparent their poisoned.",);}@@ -1006,7 +1011,7 @@ fn correct_foamed_out_the_mouth() {fn correct_foaming_out_the_mouth() {assert_suggestion_result("choking or foaming out the mouth or something like that, leading up to death",- lint_group(),+ test_linter(),"choking or foaming at the mouth or something like that, leading up to death",);}@@ -1015,7 +1020,7 @@ fn correct_foaming_out_the_mouth() {fn correct_foams_out_the_mouth() {assert_suggestion_result("Elaine can't swallow, foams out the mouth and Kramer says she has rabies just like his friend Bob Sacamano after she gets bit by the guy's dog",- lint_group(),+ test_linter(),"Elaine can't swallow, foams at the mouth and Kramer says she has rabies just like his friend Bob Sacamano after she gets bit by the guy's dog",);}@@ -1026,7 +1031,7 @@ fn correct_foams_out_the_mouth() {fn correct_flip_the_bill() {assert_suggestion_result("- SQL Compare (If the company will flip the bill)",- lint_group(),+ test_linter(),"- SQL Compare (If the company will foot the bill)",);}@@ -1035,7 +1040,7 @@ fn correct_flip_the_bill() {fn correct_flipped_the_bill() {assert_suggestion_result("As a meetup we were extremely lucky that NOVI flipped the bill for our in-person events.",- lint_group(),+ test_linter(),"As a meetup we were extremely lucky that NOVI footed the bill for our in-person events.",);}@@ -1044,7 +1049,7 @@ fn correct_flipped_the_bill() {fn correct_flipping_the_bill() {assert_suggestion_result("for the simple reason that there were no multimillion dollar company flipping the bill",- lint_group(),+ test_linter(),"for the simple reason that there were no multimillion dollar company footing the bill",);}@@ -1053,7 +1058,7 @@ fn correct_flipping_the_bill() {fn correct_flips_the_bill() {assert_suggestion_result("There seems to be a perennial debate in Illinois between urbanites and rural folk about who really flips the bill.",- lint_group(),+ test_linter(),"There seems to be a perennial debate in Illinois between urbanites and rural folk about who really foots the bill.",);}@@ -1065,7 +1070,7 @@ fn correct_flips_the_bill() {fn corrects_get_used_of() {assert_suggestion_result("I am following the examples in the documentation in order to get used of comets.",- lint_group(),+ test_linter(),"I am following the examples in the documentation in order to get used to comets.",);}@@ -1075,7 +1080,7 @@ fn corrects_get_used_of() {fn corrects_gets_used_of() {assert_suggestion_result("its like she gets used of her food and becomes spoiled",- lint_group(),+ test_linter(),"its like she gets used to her food and becomes spoiled",);}@@ -1085,7 +1090,7 @@ fn corrects_gets_used_of() {fn corrects_getting_used_of() {assert_suggestion_result("Here you can find a guide to getting used of the most important methods of magum.",- lint_group(),+ test_linter(),"Here you can find a guide to getting used to the most important methods of magum.",);}@@ -1095,7 +1100,7 @@ fn corrects_getting_used_of() {fn corrects_got_used_of() {assert_suggestion_result("we users actually got used of such delays",- lint_group(),+ test_linter(),"we users actually got used to such delays",);}@@ -1105,7 +1110,7 @@ fn corrects_got_used_of() {fn corrects_gotten_used_of() {assert_suggestion_result("The tutorial has indeed been of help, and I've gotten used of using Hull.",- lint_group(),+ test_linter(),"The tutorial has indeed been of help, and I've gotten used to using Hull.",);}@@ -1117,7 +1122,7 @@ fn corrects_grind_to_halt() {// Without this it will eventually grind to halt as it backs up upon itselfassert_suggestion_result("Without this it will eventually grind to halt as it backs up upon itself",- lint_group(),+ test_linter(),"Without this it will eventually grind to a halt as it backs up upon itself",);}@@ -1127,7 +1132,7 @@ fn corrects_grind_to_halt() {fn corrects_grind_to_halt_title_case() {assert_suggestion_result("Smart Search Tools Cause System to Grind to Halt",- lint_group(),+ test_linter(),"Smart Search Tools Cause System to Grind to a Halt",);}@@ -1136,7 +1141,7 @@ fn corrects_grind_to_halt_title_case() {fn corrects_grinding_to_halt() {assert_suggestion_result("app grinding to halt when loading many objects",- lint_group(),+ test_linter(),"app grinding to a halt when loading many objects",);}@@ -1145,7 +1150,7 @@ fn corrects_grinding_to_halt() {fn corrects_grinds_to_halt() {assert_suggestion_result("If your machine grinds to halt due to memory oversubscription, you may want to try to set the MOLD_JOBS environment variable to 1",- lint_group(),+ test_linter(),"If your machine grinds to a halt due to memory oversubscription, you may want to try to set the MOLD_JOBS environment variable to 1",);}@@ -1154,7 +1159,7 @@ fn corrects_grinds_to_halt() {fn corrects_ground_to_halt() {assert_suggestion_result("As you have probably guessed, my work on my fork has ground to halt.",- lint_group(),+ test_linter(),"As you have probably guessed, my work on my fork has ground to a halt.",);}@@ -1165,7 +1170,7 @@ fn corrects_ground_to_halt() {fn correct_has_past() {assert_suggestion_result("Track the amount of time that has past since a point in time.",- lint_group(),+ test_linter(),"Track the amount of time that has passed since a point in time.",);}@@ -1174,7 +1179,7 @@ fn correct_has_past() {fn correct_have_past() {assert_suggestion_result("Another 14+ days have past, any updates on this?",- lint_group(),+ test_linter(),"Another 14+ days have passed, any updates on this?",);}@@ -1183,7 +1188,7 @@ fn correct_have_past() {fn correct_had_past() {assert_suggestion_result("Few days had past, so im starting to thinks there is a problem in my local version.",- lint_group(),+ test_linter(),"Few days had passed, so im starting to thinks there is a problem in my local version.",);}@@ -1192,7 +1197,7 @@ fn correct_had_past() {fn correct_having_past() {assert_suggestion_result("Return to computer, with enough time having past for the computer to go to full sleep.",- lint_group(),+ test_linter(),"Return to computer, with enough time having passed for the computer to go to full sleep.",);}@@ -1203,7 +1208,7 @@ fn correct_having_past() {fn correct_hit_the_nail() {assert_suggestion_result("Ahh, found it! You hit the nail in the head once again.",- lint_group(),+ test_linter(),"Ahh, found it! You hit the nail on the head once again.",);}@@ -1212,7 +1217,7 @@ fn correct_hit_the_nail() {fn correct_hits_the_nail() {assert_suggestion_result("I'm not sure if this sentence hits the nail in the head",- lint_group(),+ test_linter(),"I'm not sure if this sentence hits the nail on the head",);}@@ -1221,7 +1226,7 @@ fn correct_hits_the_nail() {fn correct_hitting_the_nail() {assert_suggestion_result("You are hitting the nail in the head of my issue with this game, too.",- lint_group(),+ test_linter(),"You are hitting the nail on the head of my issue with this game, too.",);}@@ -1230,7 +1235,7 @@ fn correct_hitting_the_nail() {fn correct_hitted_the_nail() {assert_suggestion_result("I mean, you just kinda hitted the nail in the head. You cannot do anything with this that you couldn't do in a Raspberry PI.",- lint_group(),+ test_linter(),"I mean, you just kinda hitted the nail on the head. You cannot do anything with this that you couldn't do in a Raspberry PI.",);}@@ -1241,7 +1246,7 @@ fn correct_hitted_the_nail() {fn correct_hone_in_on() {assert_suggestion_result("This way you can use an object detector algorithm to hone in on subjects and tell sam to only focus in certain areas when looking to extend ...",- lint_group(),+ test_linter(),"This way you can use an object detector algorithm to home in on subjects and tell sam to only focus in certain areas when looking to extend ...",);}@@ -1250,7 +1255,7 @@ fn correct_hone_in_on() {fn correct_honing_in_on() {assert_suggestion_result("I think I understand the syntax limitation you're honing in on.",- lint_group(),+ test_linter(),"I think I understand the syntax limitation you're homing in on.",);}@@ -1259,7 +1264,7 @@ fn correct_honing_in_on() {fn correct_hones_in_on() {assert_suggestion_result("[FEATURE] Add a magnet that hones in on mobs",- lint_group(),+ test_linter(),"[FEATURE] Add a magnet that homes in on mobs",);}@@ -1268,7 +1273,7 @@ fn correct_hones_in_on() {fn correct_honed_in_on() {assert_suggestion_result("But it took me quite a bit of faffing about checking things out before I honed in on the session as the problem and tried to dump out the ...",- lint_group(),+ test_linter(),"But it took me quite a bit of faffing about checking things out before I homed in on the session as the problem and tried to dump out the ...",);}@@ -1278,14 +1283,14 @@ fn correct_honed_in_on() {// -in details-#[test]fn in_detail_atomic() {- assert_suggestion_result("in details", lint_group(), "in detail");+ assert_suggestion_result("in details", test_linter(), "in detail");}#[test]fn in_detail_real_world() {assert_suggestion_result("c++ - who can tell me \"*this pointer\" in details?",- lint_group(),+ test_linter(),"c++ - who can tell me \"*this pointer\" in detail?",)}@@ -1293,14 +1298,14 @@ fn in_detail_real_world() {// -in more details-#[test]fn in_more_detail_atomic() {- assert_suggestion_result("in more details", lint_group(), "in more detail");+ assert_suggestion_result("in more details", test_linter(), "in more detail");}#[test]fn in_more_detail_real_world() {assert_suggestion_result("Document the interface in more details · Issue #3 · owlbarn ...",- lint_group(),+ test_linter(),"Document the interface in more detail · Issue #3 · owlbarn ...",);}@@ -1311,7 +1316,7 @@ fn in_more_detail_real_world() {fn fix_in_this_regards() {assert_suggestion_result("I am testing many apps for our custom TROMjaro Linux, so I can be helpful in this regards.",- lint_group(),+ test_linter(),"I am testing many apps for our custom TROMjaro Linux, so I can be helpful in this regard.",);}@@ -1320,7 +1325,7 @@ fn fix_in_this_regards() {fn fix_in_that_regards() {assert_suggestion_result("Looks like that are all settings I can make in the Buderus in that regards.",- lint_group(),+ test_linter(),"Looks like that are all settings I can make in the Buderus in that regard.",);}@@ -1331,7 +1336,7 @@ fn fix_in_that_regards() {fn corrects_infliction_point() {assert_suggestion_result("You can also position the infliction point of the curve. By default it's exactly at the center in between the two connecting nodes.",- lint_group(),+ test_linter(),"You can also position the inflection point of the curve. By default it's exactly at the center in between the two connecting nodes.",);}@@ -1340,7 +1345,7 @@ fn corrects_infliction_point() {fn corrects_infliction_points() {assert_suggestion_result("... find where it touches the other side, and measure the distance. Potentially, I'd only have to do it for \"infliction points\".",- lint_group(),+ test_linter(),"... find where it touches the other side, and measure the distance. Potentially, I'd only have to do it for \"inflection points\".",);}@@ -1351,7 +1356,7 @@ fn corrects_infliction_points() {fn corrects_invest_into() {assert_suggestion_result("which represents the amount of money they want to invest into a particular deal.",- lint_group(),+ test_linter(),"which represents the amount of money they want to invest in a particular deal.",);}@@ -1360,7 +1365,7 @@ fn corrects_invest_into() {fn corrects_investing_into() {assert_suggestion_result("Taking dividends in cash (rather than automatically re-investing into the originating fund) can help alleviate the need for rebalancing.",- lint_group(),+ test_linter(),"Taking dividends in cash (rather than automatically re-investing in the originating fund) can help alleviate the need for rebalancing.",);}@@ -1369,7 +1374,7 @@ fn corrects_investing_into() {fn corrects_invested_into() {assert_suggestion_result("it's all automatically invested into a collection of loans that match the criteria that ...",- lint_group(),+ test_linter(),"it's all automatically invested in a collection of loans that match the criteria that ...",);}@@ -1378,7 +1383,7 @@ fn corrects_invested_into() {fn corrects_invests_into() {assert_suggestion_result("If a user invests into the protocol first using USDC but afterward changing to DAI, ...",- lint_group(),+ test_linter(),"If a user invests in the protocol first using USDC but afterward changing to DAI, ...",);}@@ -1387,7 +1392,7 @@ fn corrects_invests_into() {fn corrects_investment_into() {assert_suggestion_result("A $10,000 investment into the fund made on February 28, 1997 would have grown to a value of $42,650 at the end of the 20-year period.",- lint_group(),+ test_linter(),"A $10,000 investment in the fund made on February 28, 1997 would have grown to a value of $42,650 at the end of the 20-year period.",);}@@ -1398,7 +1403,7 @@ fn corrects_investment_into() {fn corrects_layouted() {assert_suggestion_result("only the views that neeed it will be measured and layouted when the superview changes",- lint_group(),+ test_linter(),"only the views that neeed it will be measured and laid out when the superview changes",);}@@ -1407,7 +1412,7 @@ fn corrects_layouted() {fn corrects_layouting() {assert_suggestion_result("An R package for layouting tables, using the S4 method",- lint_group(),+ test_linter(),"An R package for laying out tables, using the S4 method",);}@@ -1416,14 +1421,14 @@ fn corrects_layouting() {#[test]fn litotes_not_uncommon_atomic() {- assert_suggestion_result("not uncommon", lint_group(), "common");+ assert_suggestion_result("not uncommon", test_linter(), "common");}#[test]fn litotes_not_uncommon_sentence() {assert_suggestion_result("It is not uncommon to see outages during storms.",- lint_group(),+ test_linter(),"It is common to see outages during storms.",);}@@ -1432,7 +1437,7 @@ fn litotes_not_uncommon_sentence() {fn litotes_not_unlikely() {assert_suggestion_result("This outcome is not unlikely given the data.",- lint_group(),+ test_linter(),"This outcome is likely given the data.",);}@@ -1441,7 +1446,7 @@ fn litotes_not_unlikely() {fn litotes_not_insignificant() {assert_suggestion_result("That is not insignificant progress.",- lint_group(),+ test_linter(),"That is significant progress.",);}@@ -1450,7 +1455,7 @@ fn litotes_not_insignificant() {fn litotes_more_preferable() {assert_suggestion_result("Is it more preferable to use process.env.variable or env.parsed.variable?",- lint_group(),+ test_linter(),"Is it preferable to use process.env.variable or env.parsed.variable?",);}@@ -1461,7 +1466,7 @@ fn litotes_more_preferable() {fn fix_look_forward_for() {assert_suggestion_result("I will mark this issue as an enhancement and will look forward for enrolling it.",- lint_group(),+ test_linter(),"I will mark this issue as an enhancement and will look forward to enrolling it.",);}@@ -1470,7 +1475,7 @@ fn fix_look_forward_for() {fn fix_looked_forward_for() {assert_suggestion_result("Looked forward for standalone components so much, please fix this.",- lint_group(),+ test_linter(),"Looked forward to standalone components so much, please fix this.",);}@@ -1479,7 +1484,7 @@ fn fix_looked_forward_for() {fn fix_looking_forward_for() {assert_suggestion_result("Looking forward for Typed version of this stack navigation",- lint_group(),+ test_linter(),"Looking forward to Typed version of this stack navigation",);}@@ -1488,7 +1493,7 @@ fn fix_looking_forward_for() {fn fix_looks_forward_for() {assert_suggestion_result("Please take this words as from one of your fans who looks forward for a great and interesting project :)",- lint_group(),+ test_linter(),"Please take this words as from one of your fans who looks forward to a great and interesting project :)",);}@@ -1499,7 +1504,7 @@ fn fix_looks_forward_for() {fn corrects_make_due_with() {assert_suggestion_result("For now, I can make due with a bash script I have",- lint_group(),+ test_linter(),"For now, I can make do with a bash script I have",);}@@ -1508,7 +1513,7 @@ fn corrects_make_due_with() {fn corrects_made_due_with() {assert_suggestion_result("I made due with using actions.push for now but will try to do a codepen soon",- lint_group(),+ test_linter(),"I made do with using actions.push for now but will try to do a codepen soon",);}@@ -1517,7 +1522,7 @@ fn corrects_made_due_with() {fn corrects_makes_due_with() {assert_suggestion_result("but the code makes due with what is available",- lint_group(),+ test_linter(),"but the code makes do with what is available",);}@@ -1526,7 +1531,7 @@ fn corrects_makes_due_with() {fn corrects_making_due_with() {assert_suggestion_result("I've been making due with the testMultiple script I wrote above.",- lint_group(),+ test_linter(),"I've been making do with the testMultiple script I wrote above.",);}@@ -1537,7 +1542,7 @@ fn corrects_making_due_with() {fn fix_make_senses() {assert_suggestion_result("some symbols make senses only if you have a certain keyboard",- lint_group(),+ test_linter(),"some symbols make sense only if you have a certain keyboard",);}@@ -1546,7 +1551,7 @@ fn fix_make_senses() {fn fix_made_senses() {assert_suggestion_result("Usually on the examples of matlab central I have found all with positive magnitude and made senses to me.",- lint_group(),+ test_linter(),"Usually on the examples of matlab central I have found all with positive magnitude and made sense to me.",);}@@ -1555,7 +1560,7 @@ fn fix_made_senses() {fn fix_makes_senses() {assert_suggestion_result("If it makes senses I can open a PR.",- lint_group(),+ test_linter(),"If it makes sense I can open a PR.",);}@@ -1564,7 +1569,7 @@ fn fix_makes_senses() {fn fix_making_senses() {assert_suggestion_result("I appreciate you mentioned the two use cases, which are making senses for both.",- lint_group(),+ test_linter(),"I appreciate you mentioned the two use cases, which are making sense for both.",);}@@ -1574,7 +1579,7 @@ fn fix_making_senses() {// -point is mute-#[test]fn point_is_moot() {- assert_suggestion_result("Your point is mute.", lint_group(), "Your point is moot.");+ assert_suggestion_result("Your point is mute.", test_linter(), "Your point is moot.");}// OperatingSystem@@ -1583,7 +1588,7 @@ fn point_is_moot() {fn operative_system() {assert_suggestion_result("COS is a operative system made with the COSMOS Kernel and written in C#, COS its literally the same than MS-DOS but written in C# and open-source.",- lint_group(),+ test_linter(),"COS is a operating system made with the COSMOS Kernel and written in C#, COS its literally the same than MS-DOS but written in C# and open-source.",);}@@ -1592,7 +1597,7 @@ fn operative_system() {fn operative_systems() {assert_suggestion_result("My dotfiles for my operative systems and other configurations.",- lint_group(),+ test_linter(),"My dotfiles for my operating systems and other configurations.",);}@@ -1602,7 +1607,7 @@ fn operative_systems() {fn correct_passerbys() {assert_suggestion_result("For any passerbys, you may replace visibility: hidden/collapsed with: opacity: 0; pointer-events: none;.",- lint_group(),+ test_linter(),"For any passersby, you may replace visibility: hidden/collapsed with: opacity: 0; pointer-events: none;.",);}@@ -1611,7 +1616,7 @@ fn correct_passerbys() {fn correct_passer_bys_hyphen() {assert_suggestion_result("Is there any way for random willing passer-bys to help with this effort?",- lint_group(),+ test_linter(),"Is there any way for random willing passers-by to help with this effort?",);}@@ -1622,7 +1627,7 @@ fn correct_passer_bys_hyphen() {fn fix_peak() {assert_suggestion_result("Offer a peak behind the curtain of what I look for when baselining a software installation.",- lint_group(),+ test_linter(),"Offer a peek behind the curtain of what I look for when baselining a software installation.",);}@@ -1631,7 +1636,7 @@ fn fix_peak() {fn fix_peaked() {assert_suggestion_result("I peaked behind the curtain of the new Autodraw tool and noticed some expected similarities to what I saw in Quickdraw.",- lint_group(),+ test_linter(),"I peeked behind the curtain of the new Autodraw tool and noticed some expected similarities to what I saw in Quickdraw.",);}@@ -1640,7 +1645,7 @@ fn fix_peaked() {fn fix_peaking() {assert_suggestion_result("I can see how peaking behind the curtain got me to where I am today.",- lint_group(),+ test_linter(),"I can see how peeking behind the curtain got me to where I am today.",);}@@ -1649,7 +1654,7 @@ fn fix_peaking() {fn fix_peaks() {assert_suggestion_result("The Daily Vlog Series that peaks behind the curtain of an Entrepreneur's day to day life in 2016 building a business.",- lint_group(),+ test_linter(),"The Daily Vlog Series that peeks behind the curtain of an Entrepreneur's day to day life in 2016 building a business.",);}@@ -1661,14 +1666,14 @@ fn fix_peaks() {#[test]fn redundant_more_optimal() {- assert_suggestion_result("Is this more optimal?", lint_group(), "Is this optimal?");+ assert_suggestion_result("Is this more optimal?", test_linter(), "Is this optimal?");}#[test]fn redundant_most_ideal() {assert_suggestion_result("This is the most ideal scenario.",- lint_group(),+ test_linter(),"This is the ideal scenario.",);}@@ -1679,7 +1684,7 @@ fn redundant_most_ideal() {fn fix_take() {assert_suggestion_result("Is anyone wanting to step up and take responsibility of this library, or should I put it in EOL and redirect to another tool? ",- lint_group(),+ test_linter(),"Is anyone wanting to step up and take responsibility for this library, or should I put it in EOL and redirect to another tool? ",);}@@ -1688,7 +1693,7 @@ fn fix_take() {fn fix_taken() {assert_suggestion_result("if it had only taken responsibility of the manifest/info additions and extensionsID it would have made our life easier",- lint_group(),+ test_linter(),"if it had only taken responsibility for the manifest/info additions and extensionsID it would have made our life easier",);}@@ -1697,7 +1702,7 @@ fn fix_taken() {fn fix_takes() {assert_suggestion_result("If I have a message that i want to encode, who takes responsibility of pointers?",- lint_group(),+ test_linter(),"If I have a message that i want to encode, who takes responsibility for pointers?",);}@@ -1706,7 +1711,7 @@ fn fix_takes() {fn fix_taking() {assert_suggestion_result("This issue is about taking responsibility of the feature area auto indentation and start solving the bugs in the feature area.",- lint_group(),+ test_linter(),"This issue is about taking responsibility for the feature area auto indentation and start solving the bugs in the feature area.",);}@@ -1715,7 +1720,7 @@ fn fix_taking() {fn fix_took() {assert_suggestion_result("If the driver took responsibility of the locking, it could let these HTTP calls happen in parallel",- lint_group(),+ test_linter(),"If the driver took responsibility for the locking, it could let these HTTP calls happen in parallel",);}@@ -1724,7 +1729,7 @@ fn fix_took() {fn fix_assume() {assert_suggestion_result("it's a relatively big chunk of behavior to assume responsibility of",- lint_group(),+ test_linter(),"it's a relatively big chunk of behavior to assume responsibility for",);}@@ -1733,7 +1738,7 @@ fn fix_assume() {fn fix_assumed() {assert_suggestion_result("and assumed responsibility of project managing the transition of Barclays",- lint_group(),+ test_linter(),"and assumed responsibility for project managing the transition of Barclays",);}@@ -1742,7 +1747,7 @@ fn fix_assumed() {fn fix_assumes() {assert_suggestion_result("It means that the core development team assumes responsibility of the module",- lint_group(),+ test_linter(),"It means that the core development team assumes responsibility for the module",);}@@ -1751,7 +1756,7 @@ fn fix_assumes() {fn fix_assuming() {assert_suggestion_result("The point of extract is essentially that you're assuming responsibility of maintenance for that version of the formula.",- lint_group(),+ test_linter(),"The point of extract is essentially that you're assuming responsibility for maintenance for that version of the formula.",);}@@ -1760,7 +1765,7 @@ fn fix_assuming() {fn fix_claim() {assert_suggestion_result("so it doesn't need to claim responsibility of the reappearing containers lifecycle",- lint_group(),+ test_linter(),"so it doesn't need to claim responsibility for the reappearing containers lifecycle",);}@@ -1769,7 +1774,7 @@ fn fix_claim() {fn fix_claimed() {assert_suggestion_result("a group called The Impact Team had claimed responsibility of the data breach",- lint_group(),+ test_linter(),"a group called The Impact Team had claimed responsibility for the data breach",);}@@ -1778,7 +1783,7 @@ fn fix_claimed() {fn fix_claiming() {assert_suggestion_result("I feel that there should be some other way of claiming responsibility of the promise's continuation.",- lint_group(),+ test_linter(),"I feel that there should be some other way of claiming responsibility for the promise's continuation.",);}@@ -1787,7 +1792,7 @@ fn fix_claiming() {fn fix_claims() {assert_suggestion_result("yet the Lord claims responsibility of those boundaries",- lint_group(),+ test_linter(),"yet the Lord claims responsibility for those boundaries",);}@@ -1798,7 +1803,7 @@ fn fix_claims() {fn fix_an_escape_goat() {assert_suggestion_result("I see too many times the cable and ps thingy being used as an escape goat.",- lint_group(),+ test_linter(),"I see too many times the cable and ps thingy being used as a scapegoat.",);}@@ -1807,7 +1812,7 @@ fn fix_an_escape_goat() {fn fix_escape_goat() {assert_suggestion_result("It helps shift the reason for the failure on to what the manager did not do (making them the escape goat when it fails).",- lint_group(),+ test_linter(),"It helps shift the reason for the failure on to what the manager did not do (making them the scapegoat when it fails).",);}@@ -1816,7 +1821,7 @@ fn fix_escape_goat() {fn fix_escape_goats() {assert_suggestion_result("People might be using Americans as escape goats for this, but these mishearings are becoming as common as a bowl in a china shop!",- lint_group(),+ test_linter(),"People might be using Americans as scapegoats for this, but these mishearings are becoming as common as a bowl in a china shop!",);}@@ -1828,7 +1833,7 @@ fn fix_escape_goats() {fn fix_seam_to_be() {assert_suggestion_result("amdvlk is deprecated but my system still uses it as default and I can't seam to be able to change it.",- lint_group(),+ test_linter(),"amdvlk is deprecated but my system still uses it as default and I can't seem to be able to change it.",);}@@ -1837,7 +1842,7 @@ fn fix_seam_to_be() {fn fix_seams_to_be() {assert_suggestion_result("Problem: Docker image is seriously broken and everything seams to be related to trivial things like creating directory or dumping key",- lint_group(),+ test_linter(),"Problem: Docker image is seriously broken and everything seems to be related to trivial things like creating directory or dumping key",);}@@ -1847,7 +1852,7 @@ fn fix_seams_to_be() {fn fix_i_seam() {assert_suggestion_result("so now whatever i seam to try it doesnt work",- lint_group(),+ test_linter(),"so now whatever i seem to try it doesnt work",);}@@ -1857,7 +1862,7 @@ fn fix_i_seam() {fn fix_we_seam() {assert_suggestion_result("using a 4G network we seam to get ICE messages mixing Ipv6 and Ipv4",- lint_group(),+ test_linter(),"using a 4G network we seem to get ICE messages mixing Ipv6 and Ipv4",);}@@ -1867,7 +1872,7 @@ fn fix_we_seam() {fn fix_we_all_seam() {assert_suggestion_result("if it is your own nation then we all seam to get the update",- lint_group(),+ test_linter(),"if it is your own nation then we all seem to get the update",);}@@ -1878,7 +1883,7 @@ fn fix_we_all_seam() {fn fix_we_both_seam() {assert_suggestion_result("because we both seam to have enough for frivolous things",- lint_group(),+ test_linter(),"because we both seem to have enough for frivolous things",);}@@ -1888,7 +1893,7 @@ fn fix_we_both_seam() {fn fix_you_seam() {assert_suggestion_result("Assigning you, since you seam to have already made the fix.",- lint_group(),+ test_linter(),"Assigning you, since you seem to have already made the fix.",);}@@ -1898,7 +1903,7 @@ fn fix_you_seam() {fn fix_you_all_seam() {assert_suggestion_result("That's a good advice which you all seam to agree upon.",- lint_group(),+ test_linter(),"That's a good advice which you all seem to agree upon.",);}@@ -1908,7 +1913,7 @@ fn fix_you_all_seam() {fn fix_you_both_seam() {assert_suggestion_result("since you both seam to like the game",- lint_group(),+ test_linter(),"since you both seem to like the game",);}@@ -1918,7 +1923,7 @@ fn fix_you_both_seam() {fn fix_he_seams() {assert_suggestion_result("tagging @PedroTroller as he seams to still be active on this project.",- lint_group(),+ test_linter(),"tagging @PedroTroller as he seems to still be active on this project.",);}@@ -1928,7 +1933,7 @@ fn fix_he_seams() {fn fix_she_seams() {assert_suggestion_result("Here is the exact timestamp where she seams to talk about exactly this -> video.",- lint_group(),+ test_linter(),"Here is the exact timestamp where she seems to talk about exactly this -> video.",);}@@ -1938,7 +1943,7 @@ fn fix_she_seams() {fn fix_it_seams() {assert_suggestion_result("It seams i cannot use $tries and $timeout properties on my queued listener class?",- lint_group(),+ test_linter(),"It seems i cannot use $tries and $timeout properties on my queued listener class?",);}@@ -1948,7 +1953,7 @@ fn fix_it_seams() {fn fix_they_seam() {assert_suggestion_result("Lets start with the \"not\" and \"and\" gates because they seam the easiest.",- lint_group(),+ test_linter(),"Lets start with the \"not\" and \"and\" gates because they seem the easiest.",);}@@ -1958,7 +1963,7 @@ fn fix_they_seam() {fn fix_they_all_seam() {assert_suggestion_result("I have tried the sum, product, max and min functions and they all seam to work.",- lint_group(),+ test_linter(),"I have tried the sum, product, max and min functions and they all seem to work.",);}@@ -1968,7 +1973,7 @@ fn fix_they_all_seam() {fn fix_they_both_seam() {assert_suggestion_result("It's probably cause they both seam to combine martial arts with animal instincts",- lint_group(),+ test_linter(),"It's probably cause they both seem to combine martial arts with animal instincts",);}@@ -1978,7 +1983,7 @@ fn fix_they_both_seam() {fn fix_everything_seams() {assert_suggestion_result("Note that if you try to slider the slider first to the right and then to the left, everything seams alright.",- lint_group(),+ test_linter(),"Note that if you try to slider the slider first to the right and then to the left, everything seems alright.",);}@@ -1988,7 +1993,7 @@ fn fix_everything_seams() {fn fix_everybody_seams() {assert_suggestion_result("I'm currently a little disappointed because everybody seams to care only about the Rails framework",- lint_group(),+ test_linter(),"I'm currently a little disappointed because everybody seems to care only about the Rails framework",);}@@ -2007,7 +2012,7 @@ fn fix_everyone_seams() {fn fix_everyone_seams_combined_with_now_a_days() {assert_suggestion_result("everyone seams to use the editor now a days plus there is a tun of extensions available",- lint_group(),+ test_linter(),"everyone seems to use the editor nowadays plus there is a tun of extensions available",);}@@ -2019,7 +2024,7 @@ fn fix_everyone_seams_combined_with_now_a_days() {fn if_only_there_was() {assert_suggestion_result("if only there was an endpoint do to so",- lint_group(),+ test_linter(),"if only there were an endpoint do to so",);}@@ -2029,7 +2034,7 @@ fn if_only_there_was() {fn if_only_i_was() {assert_suggestion_result("Oh If only I was that clever !!",- lint_group(),+ test_linter(),"Oh If only I were that clever !!",);}@@ -2039,7 +2044,7 @@ fn if_only_i_was() {fn if_only_he_was() {assert_suggestion_result("If only he was kind enough to attempt to contact me in private first",- lint_group(),+ test_linter(),"If only he were kind enough to attempt to contact me in private first",);}@@ -2049,7 +2054,7 @@ fn if_only_he_was() {fn if_only_she_was() {assert_suggestion_result("If only she was right.",- lint_group(),+ test_linter(),"If only she were right.",);}@@ -2059,7 +2064,7 @@ fn if_only_she_was() {fn if_only_it_was() {assert_suggestion_result("if only it was accessible via USB connection - hint hint",- lint_group(),+ test_linter(),"if only it were accessible via USB connection - hint hint",);}@@ -2069,7 +2074,7 @@ fn if_only_it_was() {fn i_wish_there_was() {assert_suggestion_result("I wish there was a keyboard shortcut or something that was \"bring back the suggestion you just made in the last 3 seconds\".",- lint_group(),+ test_linter(),"I wish there were a keyboard shortcut or something that was \"bring back the suggestion you just made in the last 3 seconds\".",);}@@ -2079,7 +2084,7 @@ fn i_wish_there_was() {fn i_wish_i_was() {assert_suggestion_result("I wish I was as smart as I think I am.",- lint_group(),+ test_linter(),"I wish I were as smart as I think I am.",);}@@ -2089,7 +2094,7 @@ fn i_wish_i_was() {fn i_wish_he_was() {assert_suggestion_result("However I wish he was that smart about ARM chips present in the current mobile devices.",- lint_group(),+ test_linter(),"However I wish he were that smart about ARM chips present in the current mobile devices.",);}@@ -2099,7 +2104,7 @@ fn i_wish_he_was() {fn i_wish_she_was() {assert_suggestion_result("I wish she was more accepting of her own interests.",- lint_group(),+ test_linter(),"I wish she were more accepting of her own interests.",);}@@ -2109,7 +2114,7 @@ fn i_wish_she_was() {fn i_wish_it_was() {assert_suggestion_result("but I wish it was more friendly to existing ecosystems",- lint_group(),+ test_linter(),"but I wish it were more friendly to existing ecosystems",);}@@ -2120,7 +2125,7 @@ fn i_wish_it_was() {fn corrects_getting_use_to() {assert_suggestion_result("I'm getting use to it slowly.",- lint_group(),+ test_linter(),"I'm getting used to it slowly.",);}@@ -2129,7 +2134,7 @@ fn corrects_getting_use_to() {fn corrects_are_use_to() {assert_suggestion_result("If you are use to Ubuntu, then the way sudo works should not be strange.",- lint_group(),+ test_linter(),"If you are used to Ubuntu, then the way sudo works should not be strange.",);}@@ -2138,19 +2143,19 @@ fn corrects_are_use_to() {fn corrects_im_use_to() {assert_suggestion_result("I'm use to doing a lot of work.",- lint_group(),+ test_linter(),"I'm used to doing a lot of work.",);}#[test]fn allows_use_to_as_verb() {- assert_no_lints("This is the editor I use to write code.", lint_group());+ assert_no_lints("This is the editor I use to write code.", test_linter());}#[test]fn allows_used_to() {- assert_no_lints("I used to develop with objects in JS.", lint_group());+ assert_no_lints("I used to develop with objects in JS.", test_linter());}// WreakHavoc@@ -2159,7 +2164,7 @@ fn allows_used_to() {fn fix_wreck_havoc() {assert_suggestion_result("Tables with a \".\" in the name wreck havoc with the system",- lint_group(),+ test_linter(),"Tables with a \".\" in the name wreak havoc with the system",);}@@ -2168,7 +2173,7 @@ fn fix_wreck_havoc() {fn fix_wrecked_havoc() {assert_suggestion_result("It would have been some weird local configuration of LO that wrecked havoc.",- lint_group(),+ test_linter(),"It would have been some weird local configuration of LO that wreaked havoc.",);}@@ -2177,7 +2182,7 @@ fn fix_wrecked_havoc() {fn fix_wrecking_havoc() {assert_suggestion_result("Multi-line edit is wrecking havoc with indention",- lint_group(),+ test_linter(),"Multi-line edit is wreaking havoc with indention",);}@@ -2186,7 +2191,7 @@ fn fix_wrecking_havoc() {fn fix_wrecks_havoc() {assert_suggestion_result("Small POC using rust with ptrace that wrecks havoc on msync",- lint_group(),+ test_linter(),"Small POC using rust with ptrace that wreaks havoc on msync",);}@@ -2197,7 +2202,7 @@ fn fix_wrecks_havoc() {fn corrects_verse_against() {assert_suggestion_result("A game of Morra, with 3 different AI you can verse against.",- lint_group(),+ test_linter(),"A game of Morra, with 3 different AI you can play against.",);}@@ -2206,7 +2211,7 @@ fn corrects_verse_against() {fn corrects_versing_against() {assert_suggestion_result("This will help when you are versing against a particular boss.",- lint_group(),+ test_linter(),"This will help when you are playing against a particular boss.",);}@@ -2215,14 +2220,14 @@ fn corrects_versing_against() {fn corrects_verse_me() {assert_suggestion_result("Come verse me in this game.",- lint_group(),+ test_linter(),"Come play me in this game.",);}#[test]fn allows_versus() {- assert_no_lints("It was red versus blue in the finals.", lint_group());+ assert_no_lints("It was red versus blue in the finals.", test_linter());}// WroteToRote@@ -2231,7 +2236,7 @@ fn allows_versus() {fn fix_by_wrote() {assert_suggestion_result("Until one repeats and learns a fact by wrote it is the picture that sustains us.",- lint_group(),+ test_linter(),"Until one repeats and learns a fact by rote it is the picture that sustains us.",);}@@ -2240,7 +2245,7 @@ fn fix_by_wrote() {fn fix_by_wrote_hyphen() {assert_suggestion_result("This specification may then be translated into a recursive-decent parser almost by-wrote.",- lint_group(),+ test_linter(),"This specification may then be translated into a recursive-decent parser almost by-rote.",);}@@ -2249,7 +2254,7 @@ fn fix_by_wrote_hyphen() {fn fix_wrote_learning() {assert_suggestion_result("I found that what turned me off math class was that teachers encouraged wrote learning instead of understanding.",- lint_group(),+ test_linter(),"I found that what turned me off math class was that teachers encouraged rote learning instead of understanding.",);}@@ -2258,7 +2263,7 @@ fn fix_wrote_learning() {fn fix_wrote_memorisation() {assert_suggestion_result("Not much of a wrote memorisation kind of guy, so I preferred to commit them to memory by framing them in the context of a paragraph.",- lint_group(),+ test_linter(),"Not much of a rote memorisation kind of guy, so I preferred to commit them to memory by framing them in the context of a paragraph.",);}@@ -2267,7 +2272,7 @@ fn fix_wrote_memorisation() {fn fix_wrote_memorisation_hyphen() {assert_suggestion_result("I find it helps me retain information much better and for longer compared to when I just blindly did wrote-memorisation.",- lint_group(),+ test_linter(),"I find it helps me retain information much better and for longer compared to when I just blindly did rote-memorisation.",);}@@ -2276,7 +2281,7 @@ fn fix_wrote_memorisation_hyphen() {fn fix_wrote_memorization() {assert_suggestion_result("Outside websites are also no-go, exacerbating the need for wrote memorization.",- lint_group(),+ test_linter(),"Outside websites are also no-go, exacerbating the need for rote memorization.",);}@@ -2285,7 +2290,7 @@ fn fix_wrote_memorization() {fn fix_wrote_memorization_hyphen() {assert_suggestion_result("The voicings was the biggest game-changer for me, coming from a wrote-memorization type classical piano background.",- lint_group(),+ test_linter(),"The voicings was the biggest game-changer for me, coming from a rote-memorization type classical piano background.",);}@@ -2294,7 +2299,7 @@ fn fix_wrote_memorization_hyphen() {fn fix_wrote_memorizing() {assert_suggestion_result("I have never been good at wrote memorizing abbreviations, initialisms, or acronyms.",- lint_group(),+ test_linter(),"I have never been good at rote memorizing abbreviations, initialisms, or acronyms.",);}@@ -2307,7 +2312,7 @@ fn fix_wrote_memorizing() {fn correct_awaits_for() {assert_good_and_bad_suggestions("Headless mode awaits for requested user feedback without showing any text for what that feedback should be",- lint_group(),+ test_linter(),&["Headless mode awaits requested user feedback without showing any text for what that feedback should be","Headless mode waits for requested user feedback without showing any text for what that feedback should be",@@ -2320,7 +2325,7 @@ fn correct_awaits_for() {fn correct_awaiting_for() {assert_good_and_bad_suggestions("gpg import fails awaiting for prompt answer",- lint_group(),+ test_linter(),&["gpg import fails waiting for prompt answer","gpg import fails awaiting prompt answer",@@ -2333,7 +2338,7 @@ fn correct_awaiting_for() {fn correct_await_for() {assert_good_and_bad_suggestions("I still await for a college course on \"Followership 101\"",- lint_group(),+ test_linter(),&["I still wait for a college course on \"Followership 101\"","I still await a college course on \"Followership 101\"",@@ -2346,7 +2351,7 @@ fn correct_await_for() {fn correct_awaited_for() {assert_good_and_bad_suggestions("I have long awaited for the rise of the Dagoat agenda, and it is glorious.",- lint_group(),+ test_linter(),&["I have long awaited the rise of the Dagoat agenda, and it is glorious.","I have long waited for the rise of the Dagoat agenda, and it is glorious.",@@ -2361,7 +2366,7 @@ fn correct_awaited_for() {fn singular_towards() {assert_suggestion_result("the platform's focus on multimedia projects and VideoLAN's long history of commitment towards free and open multimedia",- lint_group(),+ test_linter(),"the platform's focus on multimedia projects and VideoLAN's long history of commitment to free and open multimedia",);}@@ -2370,7 +2375,7 @@ fn singular_towards() {fn plural_towards() {assert_suggestion_result("the signer may express multiple commitments towards the data objects",- lint_group(),+ test_linter(),"the signer may express multiple commitments to the data objects",);}@@ -2379,7 +2384,7 @@ fn plural_towards() {fn singular_toward() {assert_suggestion_result("This document outlines the current level of commitment toward Linux distributions and packaging formats.",- lint_group(),+ test_linter(),"This document outlines the current level of commitment to Linux distributions and packaging formats.",);}@@ -2388,7 +2393,7 @@ fn singular_toward() {fn plural_toward() {assert_suggestion_result("... and are expected to inform parties in updating their commitments toward the Paris Agreement",- lint_group(),+ test_linter(),"... and are expected to inform parties in updating their commitments to the Paris Agreement",);}@@ -2399,7 +2404,7 @@ fn plural_toward() {fn copywritten() {assert_suggestion_result("Including digital copies of copywritten artwork with the project isn't advised.",- lint_group(),+ test_linter(),"Including digital copies of copyrighted artwork with the project isn't advised.",);}@@ -2408,7 +2413,7 @@ fn copywritten() {fn copywrites() {assert_suggestion_result("Code is 99% copy/pasted from OpenSSH with an attempt to retain all copywrites",- lint_group(),+ test_linter(),"Code is 99% copy/pasted from OpenSSH with an attempt to retain all copyrights",);}@@ -2417,7 +2422,7 @@ fn copywrites() {fn copywrited() {assert_suggestion_result("Proprietary copywrited code",- lint_group(),+ test_linter(),"Proprietary copyrighted code",);}@@ -2426,7 +2431,7 @@ fn copywrited() {fn copywrited_all_caps() {assert_suggestion_result("URLS MAY CONTAIN COPYWRITED MATERIAL",- lint_group(),+ test_linter(),"URLS MAY CONTAIN COPYRIGHTED MATERIAL",);}@@ -2435,7 +2440,7 @@ fn copywrited_all_caps() {fn copywrote() {assert_suggestion_result("How do you find out if someone copywrote a movie",- lint_group(),+ test_linter(),"How do you find out if someone copyrighted a movie",);}@@ -2446,7 +2451,7 @@ fn copywrote() {fn correct_payed() {assert_suggestion_result("He payed the bill yesterday.",- lint_group(),+ test_linter(),"He paid the bill yesterday.",);}@@ -2455,7 +2460,7 @@ fn correct_payed() {fn correct_overpayed() {assert_suggestion_result("He overpayed in part to have the specification met.",- lint_group(),+ test_linter(),"He overpaid in part to have the specification met.",);}@@ -2466,7 +2471,7 @@ fn correct_overpayed() {fn corrects_date_back_from() {assert_good_and_bad_suggestions("There are too many open issues that date back from 4 years ago.",- lint_group(),+ test_linter(),&["There are too many open issues that date from 4 years ago.","There are too many open issues that date back to 4 years ago.",@@ -2479,7 +2484,7 @@ fn corrects_date_back_from() {fn corrects_dates_back_from() {assert_good_and_bad_suggestions("This code dates back from 2014.",- lint_group(),+ test_linter(),&["This code dates from 2014.","This code dates back to 2014.",@@ -2492,7 +2497,7 @@ fn corrects_dates_back_from() {fn allows_date_back_to() {assert_no_lints("These scripts date back to when Perl was popular.",- lint_group(),+ test_linter(),);}@@ -2506,7 +2511,7 @@ fn allows_date_back_to() {fn correct_double_edge_hyphen() {assert_suggestion_result("I thought the global defaultTranslationValues was potentially a double-edge sword as it also obfuscates the full set of values",- lint_group(),+ test_linter(),"I thought the global defaultTranslationValues was potentially a double-edged sword as it also obfuscates the full set of values",);}@@ -2515,7 +2520,7 @@ fn correct_double_edge_hyphen() {fn correct_double_edge_space() {assert_suggestion_result("It becomes a double edge sword when it should not be used in cases like this.",- lint_group(),+ test_linter(),"It becomes a double-edged sword when it should not be used in cases like this.",);}@@ -2524,7 +2529,7 @@ fn correct_double_edge_space() {fn correct_double_edge_space_plural() {assert_suggestion_result("Wake locks are really double edge swords.",- lint_group(),+ test_linter(),"Wake locks are really double-edged swords.",);}@@ -2533,7 +2538,7 @@ fn correct_double_edge_space_plural() {fn correct_double_edged_space() {assert_suggestion_result("Use case. currently OPTIMIZE is a double edged sword and potentially a very dangerous tool to use.",- lint_group(),+ test_linter(),"Use case. currently OPTIMIZE is a double-edged sword and potentially a very dangerous tool to use.",);}@@ -2542,7 +2547,7 @@ fn correct_double_edged_space() {fn correct_double_edged_space_plural() {assert_suggestion_result("Change: Ambushers and Crusaders now protect their targets too, making them double edged swords",- lint_group(),+ test_linter(),"Change: Ambushers and Crusaders now protect their targets too, making them double-edged swords",);}@@ -2553,7 +2558,7 @@ fn correct_double_edged_space_plural() {fn corrects_allocs() {assert_suggestion_result("cmd/compile: avoid allocs by better tracking of literals for interface conversions and make",- lint_group(),+ test_linter(),"cmd/compile: avoid allocations by better tracking of literals for interface conversions and make",);}@@ -2562,7 +2567,7 @@ fn corrects_allocs() {fn expand_alloc() {assert_suggestion_result("Used to find system libraries that alloc RWX regions on load.",- lint_group(),+ test_linter(),"Used to find system libraries that allocate RWX regions on load.",);}@@ -2573,7 +2578,7 @@ fn expand_alloc() {fn corrects_govt_no_dot() {assert_suggestion_result("Separation between privately issued credentials vs govt issued identity credentials",- lint_group(),+ test_linter(),"Separation between privately issued credentials vs government issued identity credentials",);}@@ -2582,7 +2587,7 @@ fn corrects_govt_no_dot() {fn corrects_govt_do() {assert_suggestion_result("Demystifying public comments on govt. regulations.",- lint_group(),+ test_linter(),"Demystifying public comments on government regulations.",);}@@ -2591,7 +2596,7 @@ fn corrects_govt_do() {fn corrects_govts() {assert_suggestion_result("Those 'elite' economists have been advising govts for years.",- lint_group(),+ test_linter(),"Those 'elite' economists have been advising governments for years.",);}@@ -2602,7 +2607,7 @@ fn corrects_govts() {fn correct_ex_pat_hyphen() {assert_suggestion_result("It seems ex-pat means the person will be in a foreign country temporarily",- lint_group(),+ test_linter(),"It seems expat means the person will be in a foreign country temporarily",);}@@ -2611,7 +2616,7 @@ fn correct_ex_pat_hyphen() {fn correct_ex_pats_hyphen() {assert_suggestion_result("So, it might be correct to call most Brits ex-pats.",- lint_group(),+ test_linter(),"So, it might be correct to call most Brits expats.",);}@@ -2620,7 +2625,7 @@ fn correct_ex_pats_hyphen() {fn correct_ex_pat_space() {assert_suggestion_result("For me, the term ex pat embodies the exquisite hypocrisy of certain people feeling entitled",- lint_group(),+ test_linter(),"For me, the term expat embodies the exquisite hypocrisy of certain people feeling entitled",);}@@ -2630,7 +2635,7 @@ fn correct_ex_pat_space() {fn correct_ex_pats_space() {assert_suggestion_result("Why are Brits who emigrate \"Ex Pats\" but people who come here \"immigrants\"?",- lint_group(),+ test_linter(),"Why are Brits who emigrate \"Expats\" but people who come here \"immigrants\"?",);}@@ -2641,7 +2646,7 @@ fn correct_ex_pats_space() {fn correct_expatriot() {assert_suggestion_result("Another expatriot of the era, James Joyce, also followed Papa's writing and drinking schedule.",- lint_group(),+ test_linter(),"Another expatriate of the era, James Joyce, also followed Papa's writing and drinking schedule.",);}@@ -2650,7 +2655,7 @@ fn correct_expatriot() {fn correct_expatriots() {assert_suggestion_result("Expatriots, upon discovering the delightful nuances of Dutch pronunciation, often find themselves in stitches.",- lint_group(),+ test_linter(),"Expatriates, upon discovering the delightful nuances of Dutch pronunciation, often find themselves in stitches.",);}@@ -2659,7 +2664,7 @@ fn correct_expatriots() {fn correct_ex_patriot_hyphen() {assert_suggestion_result("Then I added we should all be using the word 移民 immigrant, not ex-patriot, not 外国人 gaikokujin, and definitely not 外人 gaijin",- lint_group(),+ test_linter(),"Then I added we should all be using the word 移民 immigrant, not expatriate, not 外国人 gaikokujin, and definitely not 外人 gaijin",);}@@ -2668,7 +2673,7 @@ fn correct_ex_patriot_hyphen() {fn correct_ex_patriots_hyphen() {assert_suggestion_result("Ex-patriots who move to Hong Kong to seek greener pastures and to experience a new culture seem to bring their own cultural baggage with them.",- lint_group(),+ test_linter(),"Expatriates who move to Hong Kong to seek greener pastures and to experience a new culture seem to bring their own cultural baggage with them.",);}@@ -2679,7 +2684,7 @@ fn correct_ex_patriots_hyphen() {fn get_rid_off() {assert_suggestion_result("Please bump axios version to get rid off npm warning #624",- lint_group(),+ test_linter(),"Please bump axios version to get rid of npm warning #624",);}@@ -2688,7 +2693,7 @@ fn get_rid_off() {fn gets_rid_off() {assert_suggestion_result("Adding at as a runtime dependency gets rid off that error",- lint_group(),+ test_linter(),"Adding at as a runtime dependency gets rid of that error",);}@@ -2697,7 +2702,7 @@ fn gets_rid_off() {fn getting_rid_off() {assert_suggestion_result("getting rid off of all the complexity of the different accesses method of API service providers",- lint_group(),+ test_linter(),"getting rid of of all the complexity of the different accesses method of API service providers",);}@@ -2706,7 +2711,7 @@ fn getting_rid_off() {fn got_rid_off() {assert_suggestion_result("For now we got rid off circular deps in model tree structure and it's API.",- lint_group(),+ test_linter(),"For now we got rid of circular dependencies in model tree structure and it's API.",);}@@ -2715,7 +2720,7 @@ fn got_rid_off() {fn gotten_rid_off() {assert_suggestion_result("The baX variable thingy I have gotten rid off, that was due to a bad character in the encryption key.",- lint_group(),+ test_linter(),"The baX variable thingy I have gotten rid of, that was due to a bad character in the encryption key.",);}@@ -2724,7 +2729,7 @@ fn gotten_rid_off() {fn get_ride_of() {assert_suggestion_result("Get ride of \"WARNING Deprecated: markdown_github. Use gfm\"",- lint_group(),+ test_linter(),"Get rid of \"WARNING Deprecated: markdown_github. Use gfm\"",);}@@ -2733,7 +2738,7 @@ fn get_ride_of() {fn get_ride_off() {assert_suggestion_result("This exact hack was what I trying to get ride off. ",- lint_group(),+ test_linter(),"This exact hack was what I trying to get rid of. ",);}@@ -2742,7 +2747,7 @@ fn get_ride_off() {fn getting_ride_of() {assert_suggestion_result("If you have any idea how to fix this without getting ride of bootstrap I would be thankfull.",- lint_group(),+ test_linter(),"If you have any idea how to fix this without getting rid of bootstrap I would be thankfull.",);}@@ -2751,7 +2756,7 @@ fn getting_ride_of() {fn gets_ride_of() {assert_suggestion_result(".. gets ride of a central back-end/server and eliminates all the risks associated to it.",- lint_group(),+ test_linter(),".. gets rid of a central back-end/server and eliminates all the risks associated to it.",);}@@ -2760,7 +2765,7 @@ fn gets_ride_of() {fn gotten_ride_of() {assert_suggestion_result("I have gotten ride of the react-table and everything works just fine.",- lint_group(),+ test_linter(),"I have gotten rid of the react-table and everything works just fine.",);}@@ -2769,7 +2774,7 @@ fn gotten_ride_of() {fn got_ride_of() {assert_suggestion_result("I had to adjust the labels on the free version because you guys got ride of ...",- lint_group(),+ test_linter(),"I had to adjust the labels on the free version because you guys got rid of ...",);}@@ -2781,7 +2786,7 @@ fn got_ride_of() {fn correct_holy_war() {assert_suggestion_result("I know it is Holly War about idempotent in HTTP and DELETE",- lint_group(),+ test_linter(),"I know it is Holy War about idempotent in HTTP and DELETE",);}@@ -2790,7 +2795,7 @@ fn correct_holy_war() {fn correct_holly_wars() {assert_suggestion_result("Anyway I'm not starting some holly wars about this point.",- lint_group(),+ test_linter(),"Anyway I'm not starting some holy wars about this point.",);}@@ -2801,7 +2806,7 @@ fn correct_holly_wars() {fn correct_how_it_looks_like_1() {assert_suggestion_result("And here is how it looks like: As you can see, there is no real difference in the diagram itself.",- lint_group(),+ test_linter(),"And here is how it looks: As you can see, there is no real difference in the diagram itself.",);}@@ -2810,7 +2815,7 @@ fn correct_how_it_looks_like_1() {fn correct_how_it_looks_like_2() {assert_suggestion_result("This is how it looks like when run from Windows PowerShell or Cmd: image.",- lint_group(),+ test_linter(),"This is what it looks like when run from Windows PowerShell or Cmd: image.",);}@@ -2819,7 +2824,7 @@ fn correct_how_it_looks_like_2() {fn correct_how_they_look_like_1() {assert_suggestion_result("This is a sample project illustrating a demo of how to use the new Material 3 components and how they look like.",- lint_group(),+ test_linter(),"This is a sample project illustrating a demo of how to use the new Material 3 components and how they look.",);}@@ -2828,7 +2833,7 @@ fn correct_how_they_look_like_1() {fn correct_how_they_look_like_2() {assert_suggestion_result("So for now I'll just leave this issue here of how they look like in the XLSX",- lint_group(),+ test_linter(),"So for now I'll just leave this issue here of what they look like in the XLSX",);}@@ -2837,7 +2842,7 @@ fn correct_how_they_look_like_2() {fn correct_how_they_looks_like_1() {assert_suggestion_result("Here I demonstrate how disney works and how they looks like Don't miss to give me a star.",- lint_group(),+ test_linter(),"Here I demonstrate how disney works and how they look Don't miss to give me a star.",);}@@ -2846,7 +2851,7 @@ fn correct_how_they_looks_like_1() {fn correct_how_they_looks_like_2() {assert_suggestion_result("You can check how they looks like on Android app by this command:",- lint_group(),+ test_linter(),"You can check what they look like on Android app by this command:",);}@@ -2855,7 +2860,7 @@ fn correct_how_they_looks_like_2() {fn correct_how_she_looks_like_1() {assert_suggestion_result("You all know how she looks like.",- lint_group(),+ test_linter(),"You all know how she looks.",);}@@ -2864,7 +2869,7 @@ fn correct_how_she_looks_like_1() {fn correct_how_he_looks_like_2() {assert_suggestion_result("Here's how he looks like, when he's supposed to just look like his old fatui design.",- lint_group(),+ test_linter(),"Here's what he looks like, when he's supposed to just look like his old fatui design.",);}@@ -2873,7 +2878,7 @@ fn correct_how_he_looks_like_2() {fn correct_how_it_look_like_1() {assert_suggestion_result("And I don't mind how it look like, language code subpath or the last subpath as below.",- lint_group(),+ test_linter(),"And I don't mind how it looks, language code subpath or the last subpath as below.",);}@@ -2882,7 +2887,7 @@ fn correct_how_it_look_like_1() {fn correct_how_it_look_like_2() {assert_suggestion_result("Here is how it look like in your browser:",- lint_group(),+ test_linter(),"Here is what it looks like in your browser:",);}@@ -2891,7 +2896,7 @@ fn correct_how_it_look_like_2() {fn correct_how_it_looks_like_with_apostrophe() {assert_suggestion_result("In the picture we can see how It look's like on worker desktop.",- lint_group(),+ test_linter(),"In the picture we can see how It looks on worker desktop.",);}@@ -2902,7 +2907,7 @@ fn correct_how_it_looks_like_with_apostrophe() {fn corrects_in_retaliation_to_to_for() {assert_suggestion_result("Damage caused in retaliation to another attack by the Thorns enchantment.",- lint_group(),+ test_linter(),"Damage caused in retaliation for another attack by the Thorns enchantment.",);}@@ -2911,7 +2916,7 @@ fn corrects_in_retaliation_to_to_for() {fn corrects_in_retaliation_to_to_in_response_to() {assert_suggestion_result("In retaliation to disagreeing with legal naming issues, a crucial (albeit rather small) section of code was removed from the NPM database",- lint_group(),+ test_linter(),"In response to disagreeing with legal naming issues, a crucial (albeit rather small) section of code was removed from the NPM database",);}@@ -2922,7 +2927,7 @@ fn corrects_in_retaliation_to_to_in_response_to() {fn corrects_level_of_details_singular_contrived() {assert_suggestion_result("The model has a high level of details.",- lint_group(),+ test_linter(),"The model has a high level of detail.",);}@@ -2930,7 +2935,7 @@ fn corrects_level_of_details_singular_contrived() {fn corrects_levels_of_details_plural_contrived() {assert_suggestion_result("The game uses several level of details to save memory.",- lint_group(),+ test_linter(),"The game uses several levels of detail to save memory.",);}@@ -2939,7 +2944,7 @@ fn corrects_levels_of_details_plural_contrived() {fn corrects_level_of_details_singular_real_world() {assert_suggestion_result("How to implement a level of details visualizer for 3D meshes?",- lint_group(),+ test_linter(),"How to implement a level of detail visualizer for 3D meshes?",);}@@ -2948,7 +2953,7 @@ fn corrects_level_of_details_singular_real_world() {fn corrects_level_of_details_plural_real_world() {assert_suggestion_result("LOD's (Level of details) are a set of lower models used for the purpose of optimisation",- lint_group(),+ test_linter(),"LOD's (Levels of detail) are a set of lower models used for the purpose of optimisation",);}@@ -2957,7 +2962,7 @@ fn corrects_level_of_details_plural_real_world() {fn corrects_levels_of_details_real_world() {assert_suggestion_result("The file completion uses two levels of details to optimize performance.",- lint_group(),+ test_linter(),"The file completion uses two levels of detail to optimize performance.",);}@@ -2968,7 +2973,7 @@ fn corrects_levels_of_details_real_world() {fn corrects_make_it_seems() {assert_suggestion_result("but put it into unlisted list may make it seems like listed for GitHub",- lint_group(),+ test_linter(),"but put it into unlisted list may make it seem like listed for GitHub",);}@@ -2977,7 +2982,7 @@ fn corrects_make_it_seems() {fn corrects_made_it_seems() {assert_suggestion_result("previous explanations made it seems like it would be n",- lint_group(),+ test_linter(),"previous explanations made it seem like it would be n",);}@@ -2986,7 +2991,7 @@ fn corrects_made_it_seems() {fn corrects_makes_it_seems() {assert_suggestion_result("bundle gives an error that makes it seems like esbuild is trying to use lib/index.js from main",- lint_group(),+ test_linter(),"bundle gives an error that makes it seem like esbuild is trying to use lib/index.js from main",);}@@ -2995,7 +3000,7 @@ fn corrects_makes_it_seems() {fn corrects_making_it_seems() {assert_suggestion_result("Is it possible to teach the concept of assignment/reassignment at the very beginner stage instead of making it seems like constants?",- lint_group(),+ test_linter(),"Is it possible to teach the concept of assignment/reassignment at the very beginner stage instead of making it seem like constants?",);}@@ -3004,7 +3009,7 @@ fn corrects_making_it_seems() {fn corrects_made_it_seemed() {assert_suggestion_result("The path made it seemed a bit \"internal\".",- lint_group(),+ test_linter(),"The path made it seem a bit \"internal\".",);}@@ -3015,7 +3020,7 @@ fn corrects_made_it_seemed() {fn corrects_monumentous() {assert_suggestion_result("I think that would be a monumentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ...",- lint_group(),+ test_linter(),"I think that would be a momentous step in the right direction, and would DEFINATLY turn heads in not just the music industry, but every ...",);}@@ -3024,7 +3029,7 @@ fn corrects_monumentous() {fn corrects_monumentously() {assert_suggestion_result("the most impressive thing out of all of this is that GitHub created such a monumentously good name",- lint_group(),+ test_linter(),"the most impressive thing out of all of this is that GitHub created such a monumentally good name",);}@@ -3036,7 +3041,7 @@ fn corrects_monumentously() {fn correct_nerve_wreck_space_title_case() {assert_suggestion_result("How Not to Be a Complete Nerve Wreck in an Interview",- lint_group(),+ test_linter(),"How Not to Be a Complete Nervous Wreck in an Interview",);}@@ -3045,7 +3050,7 @@ fn correct_nerve_wreck_space_title_case() {fn correct_nerve_wreck_space() {assert_suggestion_result("The nerve wreck you are makes you seem anxious and agitated so your employer will believe the complaints.",- lint_group(),+ test_linter(),"The nervous wreck you are makes you seem anxious and agitated so your employer will believe the complaints.",);}@@ -3054,7 +3059,7 @@ fn correct_nerve_wreck_space() {fn correct_nerve_wreck_hyphen() {assert_suggestion_result("the child receives little education and grows up to be a nerve-wreck",- lint_group(),+ test_linter(),"the child receives little education and grows up to be a nervous wreck",);}@@ -3063,7 +3068,7 @@ fn correct_nerve_wreck_hyphen() {fn correct_nerve_wreck_hyphen_plural() {assert_suggestion_result("This helps us not to become nerve wrecks while looking at the side mirrors",- lint_group(),+ test_linter(),"This helps us not to become nervous wrecks while looking at the side mirrors",);}@@ -3073,7 +3078,7 @@ fn correct_nerve_wreck_hyphen_plural() {fn dont_correct_it_was_a_nerve_wreck() {assert_no_lints("It was a nerve-wreck, but I was also excited to see what would happen next.",- lint_group(),+ test_linter(),);}@@ -3082,7 +3087,7 @@ fn dont_correct_it_was_a_nerve_wreck() {fn dont_correct_so_much_nerve_wreck() {assert_no_lints("So much nerve wreck for such a simple game ...",- lint_group(),+ test_linter(),);}@@ -3093,7 +3098,7 @@ fn dont_correct_so_much_nerve_wreck() {fn fix_no_only_are() {assert_suggestion_result("No only are tests run on my pipeline but once successful, my app is deployed differently",- lint_group(),+ test_linter(),"Not only are tests run on my pipeline but once successful, my app is deployed differently",);}@@ -3103,7 +3108,7 @@ fn fix_no_only_are() {fn fix_no_only_is() {assert_suggestion_result("No only is it simple, it's efficient!",- lint_group(),+ test_linter(),"Not only is it simple, it's efficient!",);}@@ -3113,7 +3118,7 @@ fn fix_no_only_is() {fn fix_no_only_was() {assert_suggestion_result("No only was he happily creating shapes, but he was actively using distances and angles to do so.",- lint_group(),+ test_linter(),"Not only was he happily creating shapes, but he was actively using distances and angles to do so.",);}@@ -3123,7 +3128,7 @@ fn fix_no_only_was() {fn fix_no_only_were() {assert_suggestion_result("No only were there UI inconsistencies, but Safari lags behind chrome with things like the Popover API",- lint_group(),+ test_linter(),"Not only were there UI inconsistencies, but Safari lags behind chrome with things like the Popover API",);}@@ -3134,7 +3139,7 @@ fn fix_no_only_were() {fn fix_now_a_days_spaces() {assert_suggestion_result("Now a days, movie recommendation systems are well developed and are user focused.",- lint_group(),+ test_linter(),"Nowadays, movie recommendation systems are well developed and are user focused.",);}@@ -3143,7 +3148,7 @@ fn fix_now_a_days_spaces() {fn fix_now_a_days_apostrophe() {assert_suggestion_result("Now a day's recognizing the activity from the surveillance video is a challenging task.",- lint_group(),+ test_linter(),"Nowadays recognizing the activity from the surveillance video is a challenging task.",);}@@ -3152,7 +3157,7 @@ fn fix_now_a_days_apostrophe() {fn fix_now_a_days_hyphen() {assert_suggestion_result("Recommendation engines are now a one of the most common Machine Learning project that can be seen now-a-days.",- lint_group(),+ test_linter(),"Recommendation engines are now a one of the most common Machine Learning project that can be seen nowadays.",);}@@ -3161,7 +3166,7 @@ fn fix_now_a_days_hyphen() {fn fix_now_a_day() {assert_suggestion_result("Now a day a calendar is a daily essential things.",- lint_group(),+ test_linter(),"Nowadays a calendar is a daily essential things.",);}@@ -3170,7 +3175,7 @@ fn fix_now_a_day() {fn fix_now_a_day_hyphen() {assert_suggestion_result("Now-a-day, lots of people prefer ordering food online to save their time and effort.",- lint_group(),+ test_linter(),"Nowadays, lots of people prefer ordering food online to save their time and effort.",);}@@ -3179,7 +3184,7 @@ fn fix_now_a_day_hyphen() {fn fix_now_adays_hyphen() {assert_suggestion_result("@andyp1per knows most about those Python scripts now-adays.",- lint_group(),+ test_linter(),"@andyp1per knows most about those Python scripts nowadays.",);}@@ -3188,7 +3193,7 @@ fn fix_now_adays_hyphen() {fn fix_now_adays_space() {assert_suggestion_result("Coding is one of my fav thing to do now adays.!",- lint_group(),+ test_linter(),"Coding is one of my fav thing to do nowadays.!",);}@@ -3197,7 +3202,7 @@ fn fix_now_adays_space() {fn fix_nowaday() {assert_suggestion_result("nowaday, I have to capitalize the first letter of the name gets from @babel/types.",- lint_group(),+ test_linter(),"nowadays, I have to capitalize the first letter of the name gets from @babel/types.",);}@@ -3206,7 +3211,7 @@ fn fix_nowaday() {fn fix_now_adays_apostrophe() {assert_suggestion_result("I believe CSS clamp has great browser support now aday's as well.",- lint_group(),+ test_linter(),"I believe CSS clamp has great browser support nowadays as well.",);}@@ -3215,7 +3220,7 @@ fn fix_now_adays_apostrophe() {fn fix_nowa_days() {assert_suggestion_result("But discord would be great cause discord is universally used for all games and companies and schools nowa days.",- lint_group(),+ test_linter(),"But discord would be great cause discord is universally used for all games and companies and schools nowadays.",);}@@ -3224,7 +3229,7 @@ fn fix_nowa_days() {fn fix_now_aday() {assert_suggestion_result("OF all Occupations that now aday is used,I would not be a butcher",- lint_group(),+ test_linter(),"OF all Occupations that nowadays is used,I would not be a butcher",);}@@ -3236,7 +3241,7 @@ fn fix_now_aday() {fn detect_rise_the_question() {assert_suggestion_result("That would rise the question how to deal with syntax errors etc.",- lint_group(),+ test_linter(),"That would raise the question how to deal with syntax errors etc.",);}@@ -3245,7 +3250,7 @@ fn detect_rise_the_question() {fn detect_arise_the_question() {assert_suggestion_result("As e.g. UTC+1, might arise the question whether it includes summer and winter time",- lint_group(),+ test_linter(),"As e.g. UTC+1, might raise the question whether it includes summer and winter time",);}@@ -3255,7 +3260,7 @@ fn detect_arise_the_question() {fn detect_rises_the_question() {assert_suggestion_result("However, this rises the question as to whether this test is conceptually sound.",- lint_group(),+ test_linter(),"However, this raises the question as to whether this test is conceptually sound.",);}@@ -3264,7 +3269,7 @@ fn detect_rises_the_question() {fn detect_arises_the_question() {assert_suggestion_result("And it arises the question, why?",- lint_group(),+ test_linter(),"And it raises the question, why?",);}@@ -3274,7 +3279,7 @@ fn detect_arises_the_question() {fn detect_rising_the_question() {assert_suggestion_result("as soon as a infoHash query is performed, a Torrent file is retried, rising the question of:",- lint_group(),+ test_linter(),"as soon as a infoHash query is performed, a Torrent file is retried, raising the question of:",);}@@ -3283,7 +3288,7 @@ fn detect_rising_the_question() {fn detect_arising_the_question() {assert_suggestion_result("arising the question whether the requirement of wgpu::Features::DEPTH24PLUS_STENCIL8 is precise",- lint_group(),+ test_linter(),"raising the question whether the requirement of wgpu::Features::DEPTH24PLUS_STENCIL8 is precise",);}@@ -3293,7 +3298,7 @@ fn detect_arising_the_question() {fn detect_rose_the_question() {assert_suggestion_result("Here is an example that rose the question at first: What works.",- lint_group(),+ test_linter(),"Here is an example that raised the question at first: What works.",);}@@ -3302,7 +3307,7 @@ fn detect_rose_the_question() {fn detect_risen_the_question() {assert_suggestion_result("That has risen the question in my mind if it is still possible to embed your own Flash player on Facebook today?",- lint_group(),+ test_linter(),"That has raised the question in my mind if it is still possible to embed your own Flash player on Facebook today?",);}@@ -3311,7 +3316,7 @@ fn detect_risen_the_question() {fn detect_rised_the_question() {assert_suggestion_result("I rised the question to Emax Support and they just came back to me inmediately with the below response.",- lint_group(),+ test_linter(),"I raised the question to Emax Support and they just came back to me inmediately with the below response.",);}@@ -3321,7 +3326,7 @@ fn detect_rised_the_question() {fn dont_fag_there_arose_the_question() {assert_suggestion_result("Hello, while I have been using modals manager there arose the question related to customizing of modal header.",- lint_group(),+ test_linter(),"Hello, while I have been using modals manager there arose the question related to customizing of modal header.",);}@@ -3330,7 +3335,7 @@ fn dont_fag_there_arose_the_question() {fn detect_arised_the_question() {assert_suggestion_result("and that fact arised the question in my mind, what does exactly is happening",- lint_group(),+ test_linter(),"and that fact raised the question in my mind, what does exactly is happening",);}@@ -3339,7 +3344,7 @@ fn detect_arised_the_question() {fn detect_arose_the_question() {assert_suggestion_result("This arose the question, could I store 32 digits on the stack?",- lint_group(),+ test_linter(),"This raised the question, could I store 32 digits on the stack?",);}@@ -3348,7 +3353,7 @@ fn detect_arose_the_question() {fn detect_arisen_the_question() {assert_suggestion_result("Some have arisen the question like how to use this wireless HD mini camera",- lint_group(),+ test_linter(),"Some have raised the question like how to use this wireless HD mini camera",);}@@ -3359,7 +3364,7 @@ fn detect_arisen_the_question() {fn fix_side_tangent_start_of_sentence() {assert_suggestion_result("Side tangent: I personally wouldn't worry about using ; for removing the selection unless you need to.",- lint_group(),+ test_linter(),"Tangent: I personally wouldn't worry about using ; for removing the selection unless you need to.",);}@@ -3368,7 +3373,7 @@ fn fix_side_tangent_start_of_sentence() {fn fix_side_tangent_aside() {assert_suggestion_result("As a side tangent, in addition to not solving the gradual code repair problem",- lint_group(),+ test_linter(),"As an aside, in addition to not solving the gradual code repair problem",);}@@ -3377,7 +3382,7 @@ fn fix_side_tangent_aside() {fn fix_side_tangents() {assert_suggestion_result("so we don't get bogged down by tiny formatting bikeshedding side tangents",- lint_group(),+ test_linter(),"so we don't get bogged down by tiny formatting bikeshedding tangents",);}@@ -3389,7 +3394,7 @@ fn fix_side_tangents() {fn fix_a_bridge_too_far() {assert_suggestion_result("If Winforms can ever be conquered by the Mono developers may be a bridge to far.",- lint_group(),+ test_linter(),"If Winforms can ever be conquered by the Mono developers may be a bridge too far.",);}@@ -3399,7 +3404,7 @@ fn fix_a_bridge_too_far() {fn fix_cake_and_eat_it_too() {assert_suggestion_result("The solution: wouldn't it be great if I could have my cake and eat it to?",- lint_group(),+ test_linter(),"The solution: wouldn't it be great if I could have my cake and eat it too?",);}@@ -3409,7 +3414,7 @@ fn fix_cake_and_eat_it_too() {fn fix_go_to_far() {assert_suggestion_result("It's difficult to be sure when we go to far sometime when you don't exactly how the beast works in the background .",- lint_group(),+ test_linter(),"It's difficult to be sure when we go too far sometime when you don't exactly how the beast works in the background .",);}@@ -3419,7 +3424,7 @@ fn fix_go_to_far() {fn fix_goes_to_far() {assert_suggestion_result("Memory consumption and cpu consumption goes to far like 900% and more than this",- lint_group(),+ test_linter(),"Memory consumption and cpu consumption goes too far like 900% and more than this",);}@@ -3429,7 +3434,7 @@ fn fix_goes_to_far() {fn fix_going_to_far() {assert_suggestion_result("wsrun is going to far on this because debug 's devDependency shouldn't be considered in the cycle detection, should it?",- lint_group(),+ test_linter(),"wsrun is going too far on this because debug 's devDependency shouldn't be considered in the cycle detection, should it?",);}@@ -3439,7 +3444,7 @@ fn fix_going_to_far() {fn fix_gone_to_far() {assert_suggestion_result("I might have gone to far with opening issues for small things.",- lint_group(),+ test_linter(),"I might have gone too far with opening issues for small things.",);}@@ -3449,7 +3454,7 @@ fn fix_gone_to_far() {fn fix_went_to_far() {assert_suggestion_result("But I went to far compared to the initial request that seems talk about ...",- lint_group(),+ test_linter(),"But I went too far compared to the initial request that seems talk about ...",);}@@ -3459,7 +3464,7 @@ fn fix_went_to_far() {fn fix_life_s_too_short() {assert_suggestion_result("Life's to short for messing around with git add , writing commit message.",- lint_group(),+ test_linter(),"Life's too short for messing around with git add , writing commit message.",);}@@ -3468,7 +3473,7 @@ fn fix_life_s_too_short() {fn fix_lifes_to_short() {assert_suggestion_result("I wouldn't go back after the 3rd interview lifes to short.",- lint_group(),+ test_linter(),"I wouldn't go back after the 3rd interview life's too short.",);}@@ -3478,7 +3483,7 @@ fn fix_lifes_to_short() {fn fix_life_is_too_short() {assert_suggestion_result("[Life is to short to use dated cli tools that suck]",- lint_group(),+ test_linter(),"[Life is too short to use dated cli tools that suck]",);}@@ -3488,7 +3493,7 @@ fn fix_life_is_too_short() {fn fix_put_too_fine_a_point() {assert_suggestion_result("Not to put to fine a point on it... that's not the kind of team I think we want to be.",- lint_group(),+ test_linter(),"Not to put too fine a point on it... that's not the kind of team I think we want to be.",);}@@ -3498,7 +3503,7 @@ fn fix_put_too_fine_a_point() {fn fix_speak_too_soon() {assert_suggestion_result("I don't want to speak to soon but I kept everything as I had before but included: http = httplib2.Http()",- lint_group(),+ test_linter(),"I don't want to speak too soon but I kept everything as I had before but included: http = httplib2.Http()",);}@@ -3508,7 +3513,7 @@ fn fix_speak_too_soon() {fn fix_speaking_too_soon() {assert_suggestion_result("EDIT: Thats what I get for speaking to soon...",- lint_group(),+ test_linter(),"EDIT: Thats what I get for speaking too soon...",);}@@ -3518,7 +3523,7 @@ fn fix_speaking_too_soon() {fn fix_spoke_too_soon() {assert_suggestion_result("I spoke to soon. Ignore the previous post.",- lint_group(),+ test_linter(),"I spoke too soon. Ignore the previous post.",);}@@ -3528,7 +3533,7 @@ fn fix_spoke_too_soon() {fn fix_spoken_too_soon() {assert_suggestion_result("EDIT: I might have spoken to soon...",- lint_group(),+ test_linter(),"EDIT: I might have spoken too soon...",);}@@ -3538,7 +3543,7 @@ fn fix_spoken_too_soon() {fn fix_think_too_much() {assert_suggestion_result("I don't think to much about it, but I don't think it's a big deal.",- lint_group(),+ test_linter(),"I don't think too much about it, but I don't think it's a big deal.",);}@@ -3548,7 +3553,7 @@ fn fix_think_too_much() {fn fix_too_big_for() {assert_suggestion_result("ng-relations form to big for small screens",- lint_group(),+ test_linter(),"ng-relations form too big for small screens",);}@@ -3558,7 +3563,7 @@ fn fix_too_big_for() {fn fix_too_big_to_fail() {assert_suggestion_result("The core alone has 50k LOC. Reminds me of \"to big to fail\".",- lint_group(),+ test_linter(),"The core alone has 50k LOC. Reminds me of \"too big to fail\".",);}@@ -3568,7 +3573,7 @@ fn fix_too_big_to_fail() {fn fix_too_good_to_be_true() {assert_suggestion_result("This seemed to good to be true, but local to scene resources will not work when they are not contained in a node.",- lint_group(),+ test_linter(),"This seemed too good to be true, but local to scene resources will not work when they are not contained in a node.",);}@@ -3577,7 +3582,7 @@ fn fix_too_good_to_be_true() {fn fix_too_good_too_be_true() {assert_suggestion_result("The normalization of rewards is making the plot in tensorboard look too good too be true, because they are not the actual reward ...",- lint_group(),+ test_linter(),"The normalization of rewards is making the plot in tensorboard look too good to be true, because they are not the actual reward ...",);}@@ -3587,7 +3592,7 @@ fn fix_too_good_too_be_true() {fn fix_too_much_information() {assert_suggestion_result("Live test are printing way to much information and is polluting our test output",- lint_group(),+ test_linter(),"Live test are printing way too much information and is polluting our test output",);}@@ -3599,7 +3604,7 @@ fn fix_too_much_information() {fn fix_too_big_too_fail() {assert_suggestion_result("In other words, pointer arithmetic is, at this point, too big too fail, regardless of the clever and sophisticated way C++ lawyercats worded it.",- lint_group(),+ test_linter(),"In other words, pointer arithmetic is, at this point, too big to fail, regardless of the clever and sophisticated way C++ lawyercats worded it.",);}@@ -3608,14 +3613,14 @@ fn fix_too_big_too_fail() {#[test]fn detect_atomic_whole_entire() {- assert_suggestion_result("whole entire", lint_group(), "whole");+ assert_suggestion_result("whole entire", test_linter(), "whole");}#[test]fn correct_real_world_whole_entire() {assert_suggestion_result("[FR] support use system dns in whole entire app",- lint_group(),+ test_linter(),"[FR] support use system dns in whole app",);}@@ -3623,19 +3628,19 @@ fn correct_real_world_whole_entire() {// -a whole entire-#[test]fn correct_atomic_a_whole_entire_to_a_whole() {- assert_suggestion_result("a whole entire", lint_group(), "a whole");+ assert_suggestion_result("a whole entire", test_linter(), "a whole");}#[test]fn correct_atomic_a_whole_entire_to_an_entire() {- assert_suggestion_result("a whole entire", lint_group(), "an entire");+ assert_suggestion_result("a whole entire", test_linter(), "an entire");}#[test]fn correct_real_world_a_whole_entire_to_a_whole() {assert_suggestion_result("Start mapping a whole entire new planet using NASA’s MOLA.",- lint_group(),+ test_linter(),"Start mapping a whole new planet using NASA’s MOLA.",);}@@ -3644,7 +3649,7 @@ fn correct_real_world_a_whole_entire_to_a_whole() {fn correct_real_world_a_whole_entire_to_an_entire() {assert_suggestion_result("I am not sure I can pass in a whole entire query via the include.",- lint_group(),+ test_linter(),"I am not sure I can pass in an entire query via the include.",);}@@ -3654,14 +3659,14 @@ fn correct_real_world_a_whole_entire_to_an_entire() {// -a lot worst-#[test]fn detect_a_lot_worse_atomic() {- assert_suggestion_result("a lot worst", lint_group(), "a lot worse");+ assert_suggestion_result("a lot worst", test_linter(), "a lot worse");}#[test]fn detect_a_lot_worse_real_world() {assert_suggestion_result("On a debug build, it's even a lot worst.",- lint_group(),+ test_linter(),"On a debug build, it's even a lot worse.",);}@@ -3671,7 +3676,7 @@ fn detect_a_lot_worse_real_world() {fn fix_became_worst() {assert_suggestion_result("The problem became worst lately.",- lint_group(),+ test_linter(),"The problem became worse lately.",);}@@ -3680,7 +3685,7 @@ fn fix_became_worst() {fn fix_become_worst() {assert_suggestion_result("But results seems stay at one place or become worst.",- lint_group(),+ test_linter(),"But results seems stay at one place or become worse.",);}@@ -3689,7 +3694,7 @@ fn fix_become_worst() {fn fix_becomes_worst() {assert_suggestion_result("This becomes worst if you have an x64 dll and an x86 dll that you don't have thier source codes and want to use them in same project!",- lint_group(),+ test_linter(),"This becomes worse if you have an x64 dll and an x86 dll that you don't have thier source codes and want to use them in same project!",);}@@ -3698,7 +3703,7 @@ fn fix_becomes_worst() {fn fix_becoming_worst() {assert_suggestion_result("France is becoming worst than the Five Eyes",- lint_group(),+ test_linter(),"France is becoming worse than the Five Eyes",);}@@ -3706,14 +3711,14 @@ fn fix_becoming_worst() {// -far worse-#[test]fn detect_far_worse_atomic() {- assert_suggestion_result("far worst", lint_group(), "far worse");+ assert_suggestion_result("far worst", test_linter(), "far worse");}#[test]fn detect_far_worse_real_world() {assert_suggestion_result("I mainly use Firefox (personal preference) and have noticed it has far worst performance than Chrome",- lint_group(),+ test_linter(),"I mainly use Firefox (personal preference) and have noticed it has far worse performance than Chrome",);}@@ -3723,7 +3728,7 @@ fn detect_far_worse_real_world() {fn fix_get_worse() {assert_suggestion_result("and the problem appears to get worst with 2025.5.1 and 2025.5.2.",- lint_group(),+ test_linter(),"and the problem appears to get worse with 2025.5.1 and 2025.5.2.",);}@@ -3732,7 +3737,7 @@ fn fix_get_worse() {fn fix_gets_worse() {assert_suggestion_result("It just starts after about 15 minutes of work and gradually gets worst.",- lint_group(),+ test_linter(),"It just starts after about 15 minutes of work and gradually gets worse.",);}@@ -3745,7 +3750,7 @@ fn dont_flag_getting_worst() {// TODO: Maybe a noun following "getting" is enough context?assert_lint_count("I am getting worst accuracy on the same dataste and 3 different models.",- lint_group(),+ test_linter(),0,);}@@ -3754,7 +3759,7 @@ fn dont_flag_getting_worst() {fn fix_getting_worst() {assert_suggestion_result("But, as I said, it is getting worst...",- lint_group(),+ test_linter(),"But, as I said, it is getting worse...",);}@@ -3763,7 +3768,7 @@ fn fix_getting_worst() {fn fix_got_worst() {assert_suggestion_result("typescript support got worst.",- lint_group(),+ test_linter(),"typescript support got worse.",);}@@ -3772,7 +3777,7 @@ fn fix_got_worst() {fn fix_gotten_worst() {assert_suggestion_result("Has Claude gotten worst?",- lint_group(),+ test_linter(),"Has Claude gotten worse?",);}@@ -3780,14 +3785,14 @@ fn fix_gotten_worst() {// -much worse-#[test]fn detect_much_worse_atomic() {- assert_suggestion_result("much worst", lint_group(), "much worse");+ assert_suggestion_result("much worst", test_linter(), "much worse");}#[test]fn detect_much_worse_real_world() {assert_suggestion_result("the generated image quality is much worst (actually nearly broken)",- lint_group(),+ test_linter(),"the generated image quality is much worse (actually nearly broken)",);}@@ -3795,14 +3800,14 @@ fn detect_much_worse_real_world() {// -turn for the worse-#[test]fn detect_turn_for_the_worse_atomic() {- assert_suggestion_result("turn for the worst", lint_group(), "turn for the worse");+ assert_suggestion_result("turn for the worst", test_linter(), "turn for the worse");}#[test]fn detect_turn_for_the_worse_real_world() {assert_suggestion_result("Very surprised to see this repo take such a turn for the worst.",- lint_group(),+ test_linter(),"Very surprised to see this repo take such a turn for the worse.",);}@@ -3810,14 +3815,14 @@ fn detect_turn_for_the_worse_real_world() {// -worse than-#[test]fn detect_worse_than_atomic() {- assert_suggestion_result("worst than", lint_group(), "worse than");+ assert_suggestion_result("worst than", test_linter(), "worse than");}#[test]fn detect_worse_than_real_world() {assert_suggestion_result("Project real image - inversion quality is worst than in StyleGAN2",- lint_group(),+ test_linter(),"Project real image - inversion quality is worse than in StyleGAN2",);}@@ -3825,14 +3830,14 @@ fn detect_worse_than_real_world() {// -worst ever-#[test]fn detect_worst_ever_atomic() {- assert_suggestion_result("worse ever", lint_group(), "worst ever");+ assert_suggestion_result("worse ever", test_linter(), "worst ever");}#[test]fn detect_worst_ever_real_world() {assert_suggestion_result("The Bcl package family is one of the worse ever published by Microsoft.",- lint_group(),+ test_linter(),"The Bcl package family is one of the worst ever published by Microsoft.",);}@@ -3840,14 +3845,14 @@ fn detect_worst_ever_real_world() {// -worse and worse-#[test]fn detect_worst_and_worst_atomic() {- assert_suggestion_result("worst and worst", lint_group(), "worse and worse");+ assert_suggestion_result("worst and worst", test_linter(), "worse and worse");}#[test]fn detect_worst_and_worst_real_world() {assert_suggestion_result("This control-L trick does not work for me. The padding is getting worst and worst.",- lint_group(),+ test_linter(),"This control-L trick does not work for me. The padding is getting worse and worse.",);}@@ -3856,7 +3861,7 @@ fn detect_worst_and_worst_real_world() {fn detect_worse_and_worst_real_world() {assert_suggestion_result("This progressively got worse and worst to the point that the machine (LEAD 1010) stopped moving alltogether.",- lint_group(),+ test_linter(),"This progressively got worse and worse to the point that the machine (LEAD 1010) stopped moving alltogether.",);}@@ -3866,7 +3871,7 @@ fn detect_worse_and_worst_real_world() {fn detect_at_worst_atomic() {assert_suggestion_result("Partial moving of core objects to interpreter state is incorrect at best, unsafe at worse.",- lint_group(),+ test_linter(),"Partial moving of core objects to interpreter state is incorrect at best, unsafe at worst.",);}@@ -3876,7 +3881,7 @@ fn detect_at_worst_atomic() {fn correct_worse_case_space() {assert_suggestion_result("In the worse case scenario, remote code execution could be achieved.",- lint_group(),+ test_linter(),"In the worst-case scenario, remote code execution could be achieved.",);}@@ -3885,7 +3890,7 @@ fn correct_worse_case_space() {fn correct_worse_case_hyphen() {assert_suggestion_result("Basically I want my pods to get the original client IP address... or at least have X-Forwarded-For header, in a worse-case scenario.",- lint_group(),+ test_linter(),"Basically I want my pods to get the original client IP address... or at least have X-Forwarded-For header, in a worst-case scenario.",);}@@ -3894,7 +3899,7 @@ fn correct_worse_case_hyphen() {fn correct_worse_case_two_hyphens() {assert_suggestion_result("In a worse-case-scenario, the scenario class code and the results being analysed, become out of sync, and so the wrong labels are applied.",- lint_group(),+ test_linter(),"In a worst-case scenario, the scenario class code and the results being analysed, become out of sync, and so the wrong labels are applied.",);}@@ -3904,7 +3909,7 @@ fn correct_worse_case_two_hyphens() {fn detect_make_it_worst_atomic() {assert_suggestion_result("And if you try to access before that, CloudFront will cache the error and it'll make it worst.",- lint_group(),+ test_linter(),"And if you try to access before that, CloudFront will cache the error and it'll make it worse.",);}@@ -3914,7 +3919,7 @@ fn detect_make_it_worst_atomic() {fn detect_made_it_worst_atomic() {assert_suggestion_result("However in couple of occasions the refresh made it worst and it showed commit differences that were already commited and pushed to origin.",- lint_group(),+ test_linter(),"However in couple of occasions the refresh made it worse and it showed commit differences that were already commited and pushed to origin.",);}@@ -3924,7 +3929,7 @@ fn detect_made_it_worst_atomic() {fn detect_makes_it_worst_atomic() {assert_suggestion_result("What makes it worst, is if I use the returned SHA to try and update the newly created file I get the same error I show below.",- lint_group(),+ test_linter(),"What makes it worse, is if I use the returned SHA to try and update the newly created file I get the same error I show below.",);}@@ -3934,7 +3939,7 @@ fn detect_makes_it_worst_atomic() {fn detect_making_it_worst_atomic() {assert_suggestion_result("PLease ai realled need help with this I think I'm making it worst.",- lint_group(),+ test_linter(),"PLease ai realled need help with this I think I'm making it worse.",);}@@ -3944,7 +3949,7 @@ fn detect_making_it_worst_atomic() {fn detect_make_them_worst_atomic() {assert_suggestion_result("Not sure if this makes things clearer or make them worst.",- lint_group(),+ test_linter(),"Not sure if this makes things clearer or make them worse.",);}@@ -3954,7 +3959,7 @@ fn detect_make_them_worst_atomic() {fn detect_made_them_worst_atomic() {assert_suggestion_result("if not outroght caused them / made them worst",- lint_group(),+ test_linter(),"if not outroght caused them / made them worse",);}@@ -3964,7 +3969,7 @@ fn detect_made_them_worst_atomic() {fn detect_makes_them_worst_atomic() {assert_suggestion_result("(tried ~14 different hyperparameter and data format combos), however, always just makes them worst, they go from \"slightly\" wrong to \"complete nonsense\".",- lint_group(),+ test_linter(),"(tried ~14 different hyperparameter and data format combos), however, always just makes them worse, they go from \"slightly\" wrong to \"complete nonsense\".",);}@@ -3974,7 +3979,7 @@ fn detect_makes_them_worst_atomic() {fn dont_flag_makes_them_worst_case() {assert_lint_count("Note 1: all hash tables has an Achilles heel that makes them worst case O(N)",- lint_group(),+ test_linter(),0,);}@@ -3984,7 +3989,7 @@ fn dont_flag_makes_them_worst_case() {fn detect_making_them_worst_atomic() {assert_suggestion_result("As for the last part about Apple deliberately making them worst in order for us to buy the 3s",- lint_group(),+ test_linter(),"As for the last part about Apple deliberately making them worse in order for us to buy the 3s",);}@@ -3994,7 +3999,7 @@ fn detect_making_them_worst_atomic() {fn corrects_to_to() {assert_suggestion_result("I need to add that to my to to list first.",- lint_group(),+ test_linter(),"I need to add that to my to do list first.",);}@@ -4004,7 +4009,7 @@ fn corrects_to_to() {fn corrects_to_to_with_hyphen() {assert_suggestion_result("I need to add that to my to-to list first.",- lint_group(),+ test_linter(),"I need to add that to my to-do list first.",);}diff --git a/harper-core/src/linting/plural_decades/four_digits.rs b/harper-core/src/linting/plural_decades/four_digits.rsindex 0d137966f..fed3df76e 100644--- a/harper-core/src/linting/plural_decades/four_digits.rs+++ b/harper-core/src/linting/plural_decades/four_digits.rs@@ -90,6 +90,9 @@ pub fn match_to_lint_four_digits(#[cfg(test)]mod lints {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(PluralDecades, PluralDecades, PluralDecades::default());use super::super::PluralDecades;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};@@ -97,45 +100,33 @@ mod lints {#[test]fn eighties() {- assert_lint_count("in the 1980's", PluralDecades::default(), 1);+ assert_lint_count("in the 1980's", test_linter(), 1);}#[test]#[ignore = "wip"]fn nineties() {- assert_lint_count("the 1990’s were a bit grungy", PluralDecades::default(), 1);+ assert_lint_count("the 1990’s were a bit grungy", test_linter(), 1);}#[test]fn dont_flag_three_digits() {- assert_lint_count(- "200's doesn't look like a decade",- PluralDecades::default(),- 0,- );+ assert_lint_count("200's doesn't look like a decade", test_linter(), 0);}#[test]fn dont_flag_five_digits() {- assert_lint_count(- "20000's doesn't look like a decade",- PluralDecades::default(),- 0,- );+ assert_lint_count("20000's doesn't look like a decade", test_linter(), 0);}#[test]fn dont_flag_with_thousands_separator() {- assert_lint_count(- "Nobody says \"in the 1,950's\".",- PluralDecades::default(),- 0,- );+ assert_lint_count("Nobody says \"in the 1,950's\".", test_linter(), 0);}#[test]fn dont_flag_not_ending_with_0() {- assert_lint_count("1977's best month was October", PluralDecades::default(), 0);+ assert_lint_count("1977's best month was October", test_linter(), 0);}// Real-world examples using sentences found on GitHub@@ -148,7 +139,7 @@ mod lints {fn dont_flag_ambiguous_1900s_nppl() {assert_no_lints("star and fork 1900's gists by creating an account on GitHub.",- PluralDecades::default(),+ test_linter(),);}@@ -157,7 +148,7 @@ mod lints {fn fix_in_1900s_npsg() {assert_suggestion_result("Children Aged 0-4 in 1900's Norway.",- PluralDecades::default(),+ test_linter(),"Children Aged 0-4 in 1900s Norway.",);}@@ -167,7 +158,7 @@ mod lints {#[test]#[ignore = "Looks like a product name, not a decade"]fn ignore_hp_1910s() {- assert_no_lints("Add support for HP 1910's", PluralDecades::default());+ assert_no_lints("Add support for HP 1910's", test_linter());}// 1920s (3 examples)@@ -177,7 +168,7 @@ mod lints {fn fix_the_roaring_1920s() {assert_suggestion_result("The \"Roaring 1920's\" wasn't just about the economy and technology.",- PluralDecades::default(),+ test_linter(),"The \"Roaring 1920s\" wasn't just about the economy and technology.",);}@@ -187,7 +178,7 @@ mod lints {fn fix_special_1920s_touch() {assert_suggestion_result("It is beautiful and easily readable with that special 1920's touch.",- PluralDecades::default(),+ test_linter(),"It is beautiful and easily readable with that special 1920s touch.",);}@@ -196,7 +187,7 @@ mod lints {fn fix_in_the_1920s() {assert_suggestion_result("Sir Josiah Stamp, president of the Bank of England and the second richest man in Britain in the 1920's, speaking at the University of Texas in 1927.",- PluralDecades::default(),+ test_linter(),"Sir Josiah Stamp, president of the Bank of England and the second richest man in Britain in the 1920s, speaking at the University of Texas in 1927.",);}@@ -208,7 +199,7 @@ mod lints {fn dont_flag_ambiguous_1950s_npsg() {assert_no_lints("Simulator for 1950's MIT Whirlwind Computer.",- PluralDecades::default(),+ test_linter(),);}@@ -216,7 +207,7 @@ mod lints {fn fix_in_the_1950s() {assert_suggestion_result("Using the sandbox on the right, write and execute a query to return people born in the 1950's (1950 - 1959)",- PluralDecades::default(),+ test_linter(),"Using the sandbox on the right, write and execute a query to return people born in the 1950s (1950 - 1959)",);}@@ -226,7 +217,7 @@ mod lints {fn fix_a_adj_1950s_npsg() {assert_suggestion_result("Wave digital filter based emulation of a famous 1950's tube stereo limiter.",- PluralDecades::default(),+ test_linter(),"Wave digital filter based emulation of a famous 1950s tube stereo limiter.",);}@@ -236,7 +227,7 @@ mod lints {fn fix_1950s_npsg() {assert_suggestion_result("1950's elevator randomly gets stuck",- PluralDecades::default(),+ test_linter(),"1950s elevator randomly gets stuck",);}@@ -246,7 +237,7 @@ mod lints {fn fix_from_1950s_npsg() {assert_suggestion_result("documenting my family's camera business, from 1950's England, run by my father",- PluralDecades::default(),+ test_linter(),"documenting my family's camera business, from 1950s England, run by my father",);}@@ -255,7 +246,7 @@ mod lints {fn fix_from_1950() {assert_suggestion_result("Plot the top ten most common baby names for New South Wales by year from the 1950's",- PluralDecades::default(),+ test_linter(),"Plot the top ten most common baby names for New South Wales by year from the 1950s",);}@@ -265,7 +256,7 @@ mod lints {fn fix_1950s_brick_built_house() {assert_suggestion_result("We live in a 3 bedroom 1950's brick built house in the UK.",- PluralDecades::default(),+ test_linter(),"We live in a 3 bedroom 1950s brick built house in the UK.",);}@@ -277,7 +268,7 @@ mod lints {fn fix_a_adj_1960s_npsg() {assert_suggestion_result("Emulating a rare 1960's educational computer.",- PluralDecades::default(),+ test_linter(),"Emulating a rare 1960s educational computer.",);}@@ -285,10 +276,7 @@ mod lints {#[test]#[ignore = "Ambiguous - could be referring to the specific year 1960 or the decade 1960s"]fn ignore_ambiguous_1960s_npsg() {- assert_no_lints(- "MyTheil - 1960's IP Sprint Hillarity.",- PluralDecades::default(),- );+ assert_no_lints("MyTheil - 1960's IP Sprint Hillarity.", test_linter());}#[test]@@ -296,7 +284,7 @@ mod lints {fn fix_1960s_npsg() {assert_suggestion_result("Punchbag game inspired by 1960's TV Show Batman!",- PluralDecades::default(),+ test_linter(),"Punchbag game inspired by 1960s TV Show Batman!",);}@@ -306,7 +294,7 @@ mod lints {fn ignore_in_1960s_aperture() {assert_no_lints("Several \"SP entrances\" in 1960's Aperture have visible nodraw around entrance door",- PluralDecades::default(),+ test_linter(),);}@@ -317,7 +305,7 @@ mod lints {fn fix_1970s_npsg() {assert_suggestion_result("1970's chess engine CHEKMO-II + UCI adapter.",- PluralDecades::default(),+ test_linter(),"1970s chess engine CHEKMO-II + UCI adapter.",);}@@ -327,7 +315,7 @@ mod lints {fn fix_vprog_1970s_nppl_dates() {assert_suggestion_result("listsockets printing 1970's dates.",- PluralDecades::default(),+ test_linter(),"listsockets printing 1970s dates.",);}@@ -336,7 +324,7 @@ mod lints {fn fix_in_a_1970s_style_npsg() {assert_suggestion_result("I tried to create some catwalk in a 1970's style level.",- PluralDecades::default(),+ test_linter(),"I tried to create some catwalk in a 1970s style level.",);}@@ -346,7 +334,7 @@ mod lints {fn fix_1970s_pong_game() {assert_suggestion_result("1970's Pong game rewritten in C++.",- PluralDecades::default(),+ test_linter(),"1970s Pong game rewritten in C++.",);}@@ -356,7 +344,7 @@ mod lints {fn fix_1970s_in_parens() {assert_suggestion_result("Convert a MIDI file to a record compatible with vintage (1970's) Fisher Price music box record players",- PluralDecades::default(),+ test_linter(),"Convert a MIDI file to a record compatible with vintage (1970s) Fisher Price music box record players",);}@@ -365,7 +353,7 @@ mod lints {fn fix_in_the_1970s() {assert_suggestion_result("may have begun, depending on when you start counting, in the 1970's.",- PluralDecades::default(),+ test_linter(),"may have begun, depending on when you start counting, in the 1970s.",);}@@ -374,7 +362,7 @@ mod lints {fn ignore_username_hyphen_1970s_gists() {assert_no_lints("GitHub Gist: star and fork ricardo-reis-1970's gists by creating an account on GitHub.",- PluralDecades::default(),+ test_linter(),);}@@ -383,7 +371,7 @@ mod lints {fn fix_after_1970s_nppl_minicomputers() {assert_suggestion_result("I'm also working on extending it as my CPU is modelled after 1970's minicomputers",- PluralDecades::default(),+ test_linter(),"I'm also working on extending it as my CPU is modelled after 1970s minicomputers",);}@@ -392,7 +380,7 @@ mod lints {fn fix_of_the_1970s() {assert_suggestion_result("I despise both as outdated, hard to use relics of the 1970's.",- PluralDecades::default(),+ test_linter(),"I despise both as outdated, hard to use relics of the 1970s.",);}@@ -401,7 +389,7 @@ mod lints {fn fix_couples_in_the_1970s() {assert_suggestion_result("This visualization tracks a sample of couples in the 1970's to show how long they transition through relationship stages.",- PluralDecades::default(),+ test_linter(),"This visualization tracks a sample of couples in the 1970s to show how long they transition through relationship stages.",);}@@ -410,7 +398,7 @@ mod lints {fn fix_developed_in_early_1970s() {assert_suggestion_result("GPS, originally developed in the early 1970's, is a unidirectional (broadcast only) system",- PluralDecades::default(),+ test_linter(),"GPS, originally developed in the early 1970s, is a unidirectional (broadcast only) system",);}@@ -421,7 +409,7 @@ mod lints {fn fix_from_the_1980s_like() {assert_suggestion_result("Old Stern tables from the 1980's like Flight 2000, Catacomb, etc. are playing audio samples twice, it seems.",- PluralDecades::default(),+ test_linter(),"Old Stern tables from the 1980s like Flight 2000, Catacomb, etc. are playing audio samples twice, it seems.",);}@@ -431,7 +419,7 @@ mod lints {fn fix_its_the_1980s() {assert_suggestion_result("Declarative Rapid Application Development like it's the 1980's again.",- PluralDecades::default(),+ test_linter(),"Declarative Rapid Application Development like it's the 1980s again.",);}@@ -440,7 +428,7 @@ mod lints {fn fix_from_the_1980s_end() {assert_suggestion_result("Former countries from the 1980's",- PluralDecades::default(),+ test_linter(),"Former countries from the 1980s",);}@@ -450,7 +438,7 @@ mod lints {fn fix_a_1980s_npsg() {assert_suggestion_result("A re-imiplementation of a classic 1980's DOS game, but in D.",- PluralDecades::default(),+ test_linter(),"A re-imiplementation of a classic 1980s DOS game, but in D.",);}@@ -459,7 +447,7 @@ mod lints {fn fix_of_the_1980s() {assert_suggestion_result("The Pugputer is a little labor of love, made as a tribute to the early home computers of the 1980's.",- PluralDecades::default(),+ test_linter(),"The Pugputer is a little labor of love, made as a tribute to the early home computers of the 1980s.",);}@@ -468,7 +456,7 @@ mod lints {fn fix_of_the_1980s_npsg() {assert_suggestion_result("FPGA implementation of the 1980's \"Music 5000\" wavetable synthesiser",- PluralDecades::default(),+ test_linter(),"FPGA implementation of the 1980s \"Music 5000\" wavetable synthesiser",);}@@ -477,7 +465,7 @@ mod lints {fn fix_based_off_of_the_1980s_npsg() {assert_suggestion_result("Space Fortress is based off of the 1980's vector-based arcade game by Cinematronics called Star Castle.",- PluralDecades::default(),+ test_linter(),"Space Fortress is based off of the 1980s vector-based arcade game by Cinematronics called Star Castle.",);}@@ -487,7 +475,7 @@ mod lints {fn ignore_ambiguous_1980s() {assert_no_lints("1980's Old aperture coop checkpoint uses the timer signage instead of checkmarks.",- PluralDecades::default(),+ test_linter(),);}@@ -496,7 +484,7 @@ mod lints {fn fix_1980s_nppl() {assert_suggestion_result("A project resurrecting the classic 1980's Usborne Computer Guide books, for a new generation of programmers.",- PluralDecades::default(),+ test_linter(),"A project resurrecting the classic 1980s Usborne Computer Guide books, for a new generation of programmers.",);}@@ -506,7 +494,7 @@ mod lints {fn fix_the_end_of_missing_determiner_1980s() {assert_suggestion_result("System software for TIM011, a school computer from the end of 1980's made in former Yugoslavia",- PluralDecades::default(),+ test_linter(),"System software for TIM011, a school computer from the end of the 1980s made in former Yugoslavia",);}@@ -515,7 +503,7 @@ mod lints {fn fix_in_the_1980s_for() {assert_suggestion_result("HMSL was originally released in the 1980's for Mac Plus and Amiga",- PluralDecades::default(),+ test_linter(),"HMSL was originally released in the 1980s for Mac Plus and Amiga",);}@@ -525,7 +513,7 @@ mod lints {fn fix_the_adj_1980s_npsg() {assert_suggestion_result("Modern remake of Pole Position, the classic 1980's arcade racing game from Atari.",- PluralDecades::default(),+ test_linter(),"Modern remake of Pole Position, the classic 1980s arcade racing game from Atari.",);}@@ -534,7 +522,7 @@ mod lints {fn fix_since_the_1980s() {assert_suggestion_result("Since the 1980's the most common way to interact with a computer is via the graphical user interface (GUI)",- PluralDecades::default(),+ test_linter(),"Since the 1980s the most common way to interact with a computer is via the graphical user interface (GUI)",);}@@ -546,7 +534,7 @@ mod lints {fn fix_the_adj_1990s_npsg() {assert_suggestion_result("42 3d Graphics Project, recreating the classic 1990's game Wolfienstien 3d",- PluralDecades::default(),+ test_linter(),"42 3d Graphics Project, recreating the classic 1990s game Wolfienstien 3d",);}@@ -556,7 +544,7 @@ mod lints {fn fix_a_1990s_npsg() {assert_suggestion_result("A 1990's Retro linux-rice for Hyprland or Sway, based on Quickshell.",- PluralDecades::default(),+ test_linter(),"A 1990s Retro linux-rice for Hyprland or Sway, based on Quickshell.",);}@@ -566,7 +554,7 @@ mod lints {fn lacks_determiner_stuck_in_1990s() {assert_suggestion_result("Docs are stuck in 1990's - need AWS or Azure example",- PluralDecades::default(),+ test_linter(),"Docs are stuck in the 1990s - need AWS or Azure example",);}@@ -576,7 +564,7 @@ mod lints {fn fix_the_1990s_npsg() {assert_suggestion_result("This program recreates the 1990's arcade game \"Boulder Dash.\"",- PluralDecades::default(),+ test_linter(),"This program recreates the 1990s arcade game \"Boulder Dash.\"",);}@@ -585,7 +573,7 @@ mod lints {fn fix_in_the_1990s_comma() {assert_suggestion_result("In the 1990's, Innovative Computer Solutions released multiple programs for the Newton MessagePad as shareware",- PluralDecades::default(),+ test_linter(),"In the 1990s, Innovative Computer Solutions released multiple programs for the Newton MessagePad as shareware",);}@@ -594,7 +582,7 @@ mod lints {fn fix_a_mid_1990s_npsg() {assert_suggestion_result("This repository is a modernization of a mid 1990's implementation of the ZMODEM protocol called 'zmtx-zmrx'.",- PluralDecades::default(),+ test_linter(),"This repository is a modernization of a mid 1990s implementation of the ZMODEM protocol called 'zmtx-zmrx'.",);}@@ -604,7 +592,7 @@ mod lints {fn lacks_determiner_written_in_java_in_1990s() {assert_suggestion_result("JMud, mud server written in Java in 1990's.",- PluralDecades::default(),+ test_linter(),"JMud, mud server written in Java in the 1990s.",);}@@ -614,7 +602,7 @@ mod lints {fn fix_a_adj_1990s_npsg() {assert_suggestion_result("Port of a famous 1990's fighting game to MSX2.",- PluralDecades::default(),+ test_linter(),"Port of a famous 1990s fighting game to MSX2.",);}@@ -624,7 +612,7 @@ mod lints {fn fix_circa_1990s() {assert_suggestion_result("Inspired by Digimon \"Digivices\" tamagotchis circa 1990's.",- PluralDecades::default(),+ test_linter(),"Inspired by Digimon \"Digivices\" tamagotchis circa the 1990s.",);}@@ -634,7 +622,7 @@ mod lints {fn fix_for_1990s_nppl() {assert_suggestion_result("Daughter-board for reprogramming 1990's Toyota ECUs",- PluralDecades::default(),+ test_linter(),"Daughter-board for reprogramming 1990s Toyota ECUs",);}@@ -643,7 +631,7 @@ mod lints {fn fix_the_1990s_classic_mario_hit() {assert_suggestion_result("A remake of the 1990's classic mario hit.",- PluralDecades::default(),+ test_linter(),"A remake of the 1990s classic mario hit.",);}@@ -652,7 +640,7 @@ mod lints {fn fix_developed_in_early_1990s() {assert_suggestion_result("The code was originally developed in the early 1990's",- PluralDecades::default(),+ test_linter(),"The code was originally developed in the early 1990s",);}@@ -663,7 +651,7 @@ mod lints {fn fix_2000s_style() {assert_suggestion_result("2000's-style media library for vintage cellphones (Nokia, etc.)",- PluralDecades::default(),+ test_linter(),"2000s-style media library for vintage cellphones (Nokia, etc.)",);}@@ -672,7 +660,7 @@ mod lints {fn ignore_fork_username_hyphen_2000s_nppl() {assert_no_lints("star and fork vishal-2000's gists by creating an account on GitHub.",- PluralDecades::default(),+ test_linter(),);}@@ -680,7 +668,7 @@ mod lints {fn fix_in_the_2000s() {assert_suggestion_result("Simulator engine for reproducing LCD games made by McDonald's in the 2000's.",- PluralDecades::default(),+ test_linter(),"Simulator engine for reproducing LCD games made by McDonald's in the 2000s.",);}@@ -690,24 +678,21 @@ mod lints {fn fix_in_the_early_2000s_missing_determiner() {assert_suggestion_result("Silo was originally released in early 2000's using LLNL-home-grown license verbiage.",- PluralDecades::default(),+ test_linter(),"Silo was originally released in the early 2000s using LLNL-home-grown license verbiage.",);}#[test]fn ignore_view_username_hyphen_2000s_npsg() {- assert_no_lints(- "View lxw-2000's full-sized avatar.",- PluralDecades::default(),- );+ assert_no_lints("View lxw-2000's full-sized avatar.", test_linter());}#[test]fn fix_early_2000s_style_npsg() {assert_suggestion_result("Early 2000's Style Personal Webpage.",- PluralDecades::default(),+ test_linter(),"Early 2000s Style Personal Webpage.",);}@@ -716,7 +701,7 @@ mod lints {fn fix_from_the_mid_2000s() {assert_suggestion_result("Modeled after the now-defunct Geosense game from the mid 2000's",- PluralDecades::default(),+ test_linter(),"Modeled after the now-defunct Geosense game from the mid 2000s",);}@@ -725,7 +710,7 @@ mod lints {fn fix_for_the_early_2000s_games() {assert_suggestion_result("GothicKit is a community-run organization hosting libraries and tools for the early 2000's games Gothic and Gothic II.",- PluralDecades::default(),+ test_linter(),"GothicKit is a community-run organization hosting libraries and tools for the early 2000s games Gothic and Gothic II.",);}@@ -734,7 +719,7 @@ mod lints {fn fix_back_in_the_2000s() {assert_suggestion_result("A basic music player/organizer I created back in the 2000's - carderne/CAMO.",- PluralDecades::default(),+ test_linter(),"A basic music player/organizer I created back in the 2000s - carderne/CAMO.",);}@@ -743,7 +728,7 @@ mod lints {fn fix_mid_2000s() {assert_suggestion_result("Things I wrote about RDF from the mid-2000's.",- PluralDecades::default(),+ test_linter(),"Things I wrote about RDF from the mid-2000s.",);}@@ -755,7 +740,7 @@ mod lints {fn ignore_author_2010s_publication_reference() {assert_no_lints("CLDF version of Sinnemäki 2010's dataset on zero marking and word order",- PluralDecades::default(),+ test_linter(),);}@@ -764,7 +749,7 @@ mod lints {fn ignore_bazel_calls_vs_2010s_cl() {assert_no_lints("Bazel calls VS 2010's cl with /DEBUG:FASTLINK",- PluralDecades::default(),+ test_linter(),);}@@ -772,7 +757,7 @@ mod lints {fn fix_since_the_early_2010s() {assert_suggestion_result("the degree of drop-off of CouchDB online community activity since the early-2010's NoSQL craze faded",- PluralDecades::default(),+ test_linter(),"the degree of drop-off of CouchDB online community activity since the early-2010s NoSQL craze faded",);}@@ -781,7 +766,7 @@ mod lints {fn fix_blog_posts_of_the_2010s() {assert_suggestion_result("It's jumped off the esoteric analytics blog posts of the 2010's and on to your television screens and into your video games",- PluralDecades::default(),+ test_linter(),"It's jumped off the esoteric analytics blog posts of the 2010s and on to your television screens and into your video games",);}@@ -793,7 +778,7 @@ mod lints {fn ignore_ambiguous_2020s() {assert_no_lints("This is a bot for Legends of Code and Magic submitted to the IEEE CEC 2020's Strategy Card Game AI Competition.",- PluralDecades::default(),+ test_linter(),);}@@ -802,7 +787,7 @@ mod lints {fn ignore_ambiguous_2020s_2() {assert_no_lints("CSSPI Fall 2020's frontend mobile web application utilizing React Native.",- PluralDecades::default(),+ test_linter(),);}@@ -811,7 +796,7 @@ mod lints {fn ignore_ambiguous_2020s_2024s() {assert_no_lints("App that converts MSFS 2020's DDS texture format to MSFS 2024's KTX2 format",- PluralDecades::default(),+ test_linter(),);}@@ -820,17 +805,14 @@ mod lints {fn ignore_erum_2020s() {assert_no_lints("A repository for purposes of eRum 2020's workshop \"Image processing and computer vision with R\", held on Saturday, June 20, 2020.",- PluralDecades::default(),+ test_linter(),);}#[test]#[ignore = "Ambiguous. Not sure what it means"]fn ignore_ambiguous_2020s_3() {- assert_no_lints(- "Crashing upon loading saved game in 2020's",- PluralDecades::default(),- );+ assert_no_lints("Crashing upon loading saved game in 2020's", test_linter());}#[test]@@ -838,31 +820,25 @@ mod lints {fn ignore_defcon_2020s_event() {assert_no_lints("Reimplementation of DEF CON 2020's Pinboool Binary - pinboool.py.",- PluralDecades::default(),+ test_linter(),);}#[test]fn ignore_username_hyphen_2020s_avatar() {- assert_no_lints(- "View theredpill-2020's full-sized avatar.",- PluralDecades::default(),- );+ assert_no_lints("View theredpill-2020's full-sized avatar.", test_linter());}#[test]#[ignore = "Ambiguous. Not sure what it means"]fn ignore_ambiguous_2020s_scipy() {- assert_no_lints(- "No imread() in 2020's Scipy v1.5.x.",- PluralDecades::default(),- );+ assert_no_lints("No imread() in 2020's Scipy v1.5.x.", test_linter());}#[test]#[ignore = "ambiguous"]fn ignore_pull_into_2020s() {- assert_no_lints("Pull into the 2020's.", PluralDecades::default());+ assert_no_lints("Pull into the 2020's.", test_linter());}#[test]@@ -870,7 +846,7 @@ mod lints {fn ignore_blasas_et_al_2020s() {assert_no_lints("Scripts that were used to create figure 5 in Blasas et al. 2020's \"FUT9-driven programming of colon cancer cells towards a stem cell-like state\"",- PluralDecades::default(),+ test_linter(),);}@@ -880,7 +856,7 @@ mod lints {fn fix_in_the_1990s_and_the_2000s() {assert_suggestion_result("NTXShape, a converter I developed in the 1990's and maintained through the 2000's",- PluralDecades::default(),+ test_linter(),"NTXShape, a converter I developed in the 1990s and maintained through the 2000s",);}@@ -889,7 +865,7 @@ mod lints {fn fix_early_2000s_early_1990s_early_1980s() {assert_suggestion_result("CDISC since 2005, XML since the early 2000's, @SAS since the early 1990's, Programming since the early 1980's.",- PluralDecades::default(),+ test_linter(),"CDISC since 2005, XML since the early 2000s, @SAS since the early 1990s, Programming since the early 1980s.",);}@@ -899,7 +875,7 @@ mod lints {fn fix_dates_in_the_1960s_comma_1950s_early_1900s() {assert_suggestion_result("OK for dates in the 1960's, 1950's... Now... I expect 1939-12-31T23 ... Was Belgium ever not in UTC+1 timezone in early 1900's ?",- PluralDecades::default(),+ test_linter(),"OK for dates in the 1960s, 1950s... Now... I expect 1939-12-31T23 ... Was Belgium ever not in UTC+1 timezone in early 1900s ?",);}@@ -908,7 +884,7 @@ mod lints {fn fix_late_1970s_early_1980s() {assert_suggestion_result("Late 1970's/Early 1980's Text Adventure Game from the Mainframe era",- PluralDecades::default(),+ test_linter(),"Late 1970s/Early 1980s Text Adventure Game from the Mainframe era",);}@@ -917,7 +893,7 @@ mod lints {fn fix_in_the_1970s_and_early_1980s() {assert_suggestion_result("We modeled the gas mileage of 398 cars built in the 1970's and early 1980's",- PluralDecades::default(),+ test_linter(),"We modeled the gas mileage of 398 cars built in the 1970s and early 1980s",);}@@ -926,7 +902,7 @@ mod lints {fn fix_from_the_late_1970s_early_1980s() {assert_suggestion_result("Europe Card Bus (ECB) is a Retro CPU Bus standard from the late 1970's / early 1980's.",- PluralDecades::default(),+ test_linter(),"Europe Card Bus (ECB) is a Retro CPU Bus standard from the late 1970s / early 1980s.",);}@@ -936,7 +912,7 @@ mod lints {fn ignore_on_80s_on_90s_on_2000s_on_2010s_on_2020s() {assert_no_lints("Developer on 80's, software engineer on 90's, tech lead on 2000's, manager from 2010's on and CIO/CDO/CTO on 2020's",- PluralDecades::default(),+ test_linter(),);}@@ -945,7 +921,7 @@ mod lints {fn fix_in_the_80s_in_the_90s_2000s_2010s() {assert_suggestion_result("UUCP BBS in the 80's Winternet / ABX Net Un Hacking in the 90's FOU 2000's CIS Inc. 2010's For Every Hacker there is an Equal and Opposite Hacker.",- PluralDecades::default(),+ test_linter(),"UUCP BBS in the 80s Winternet / ABX Net Un Hacking in the 90s FOU 2000s CIS Inc. 2010s For Every Hacker there is an Equal and Opposite Hacker.",);}@@ -955,7 +931,7 @@ mod lints {fn fix_in_the_1990s_and_2000s() {assert_suggestion_result("Edelman and his colleagues in the 1990's and 2000's.",- PluralDecades::default(),+ test_linter(),"Edelman and his colleagues in the 1990s and 2000s.",);}@@ -965,7 +941,7 @@ mod lints {fn fix_1930s_ampersand_1940s() {assert_suggestion_result("DJ and collector of quality tango music from the golden era (1930's & 1940's)",- PluralDecades::default(),+ test_linter(),"DJ and collector of quality tango music from the golden era (1930s & 1940s)",);}@@ -975,7 +951,7 @@ mod lints {fn fix_80s_90s_2000s_2020s() {assert_suggestion_result("Nerdy coder-kid on ZX81 and Oric 1 in the 80's, nerdy teen-tech writer on PC in 90's, nerdy engineer in the 2000's, 2020's MongoDB addict, Databricks fan now!",- PluralDecades::default(),+ test_linter(),"Nerdy coder-kid on ZX81 and Oric 1 in the 80s, nerdy teen-tech writer on PC in 90s, nerdy engineer in the 2000s, 2020s MongoDB addict, Databricks fan now!",);}diff --git a/harper-core/src/linting/plural_decades/two_digits.rs b/harper-core/src/linting/plural_decades/two_digits.rsindex c9d5f3c61..98dfc9278 100644--- a/harper-core/src/linting/plural_decades/two_digits.rs+++ b/harper-core/src/linting/plural_decades/two_digits.rs@@ -152,6 +152,9 @@ pub fn match_to_lint_two_digits(#[cfg(test)]mod lints {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(PluralDecades, PluralDecades, PluralDecades::default());use super::super::PluralDecades;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};@@ -159,28 +162,28 @@ mod lints {#[test]fn eighties() {- assert_lint_count("in the 80's", PluralDecades::default(), 1);+ assert_lint_count("in the 80's", test_linter(), 1);}#[test]#[ignore = "wip"]fn nineties() {- assert_lint_count("the 90’s were a bit grungy", PluralDecades::default(), 1);+ assert_lint_count("the 90’s were a bit grungy", test_linter(), 1);}#[test]fn dont_flag_three_digits() {- assert_no_lints("200's doesn't look like a decade", PluralDecades::default());+ assert_no_lints("200's doesn't look like a decade", test_linter());}#[test]fn dont_flag_one_digit() {- assert_no_lints("0's doesn't look like a decade", PluralDecades::default());+ assert_no_lints("0's doesn't look like a decade", test_linter());}#[test]fn dont_flag_not_ending_with_0() {- assert_no_lints("'77's best month was October", PluralDecades::default());+ assert_no_lints("'77's best month was October", test_linter());}// Real-world examples using sentences found on GitHub@@ -192,7 +195,7 @@ mod lints {fn dont_flag_dot_version_numbers() {assert_no_lints("A bug is apparently in FOG 1.5.10's normalize() function inside init.xz.",- PluralDecades::default(),+ test_linter(),);}@@ -201,7 +204,7 @@ mod lints {fn fix_showing_the_10s_of_hours() {assert_suggestion_result("It took 10's of hours to debug this issue",- PluralDecades::default(),+ test_linter(),"It took 10s of hours to debug this issue",);}@@ -210,7 +213,7 @@ mod lints {fn dont_flag_windows_10() {assert_no_lints("How about Windows 10's taskbar progress bar?",- PluralDecades::default(),+ test_linter(),);}@@ -219,7 +222,7 @@ mod lints {fn dont_flag_space_version_numbers_resharper_10() {assert_no_lints("\"gd\" doesn't work correctly with ReSharper 10's \"Usage-aware Go to Declaration\"",- PluralDecades::default(),+ test_linter(),);}@@ -228,7 +231,7 @@ mod lints {fn dont_flag_space_version_numbers_mermaid_10() {assert_no_lints("mermaid 10's ESM only support breaks compat with many apps",- PluralDecades::default(),+ test_linter(),);}@@ -237,7 +240,7 @@ mod lints {fn dont_flag_npm_10s_npsg() {assert_no_lints("Align npm packages to npm 10's node engine range",- PluralDecades::default(),+ test_linter(),);}@@ -245,7 +248,7 @@ mod lints {fn dont_flag_xcode_10s_version_number() {assert_no_lints("Leverage Xcode 10's new \"File list\" feature for input/output files of Run Script build phases",- PluralDecades::default(),+ test_linter(),);}@@ -254,7 +257,7 @@ mod lints {fn dont_flag_modo_10s_version_number() {assert_no_lints("Modo 10's Unreal editor plugin (for loading PBR materials / textures)",- PluralDecades::default(),+ test_linter(),);}@@ -262,7 +265,7 @@ mod lints {fn dont_flag_windows_10s_touch_keyboard() {assert_no_lints("Arrow Key Command History Navigation Not Working Using Windows 10's Built-in 'Touch Keyboard'",- PluralDecades::default(),+ test_linter(),);}@@ -270,7 +273,7 @@ mod lints {fn dont_flag_android_10s_scoped_storage() {assert_no_lints("Android 10's Scoped storage using Image picker (Gallery / Camera) with compression example.",- PluralDecades::default(),+ test_linter(),);}@@ -278,7 +281,7 @@ mod lints {fn dont_flag_windows_10s_openssh() {assert_no_lints("If I try to set Windows 10's OpenSSH ssh-agent.exe as the pageant executable, I get an error message",- PluralDecades::default(),+ test_linter(),);}@@ -287,7 +290,7 @@ mod lints {fn dont_flag_node10s_resolution_algorithm() {assert_no_lints("node10 encoded Node.js 10's resolution algorithm, which predates ESM support",- PluralDecades::default(),+ test_linter(),);}@@ -295,7 +298,7 @@ mod lints {fn dont_flag_xcode_10s_new_build_system() {assert_no_lints("Fixes the third party dependency issues introduced by Xcode 10's new build system.",- PluralDecades::default(),+ test_linter(),);}@@ -303,7 +306,7 @@ mod lints {fn dont_flag_windows_10s_controlled_folder_access() {assert_no_lints("NVDA install fails when Windows 10's Controlled Folder Access is enabled",- PluralDecades::default(),+ test_linter(),);}@@ -311,7 +314,7 @@ mod lints {fn dont_flag_windows_10s_wsl() {assert_no_lints("By default Windows 10's WSL has trouble opening paths on mounted VeraCrypt volumes.",- PluralDecades::default(),+ test_linter(),);}@@ -321,30 +324,27 @@ mod lints {fn dont_flag_cpp20s_std_span() {assert_no_lints("This repository contains a single-header implementation of C++20's std::span, conforming to the C++20 committee draft.",- PluralDecades::default(),+ test_linter(),);}#[test]#[ignore = "wip"]fn dont_flag_space_version_numbers_virtualenv_20() {- assert_no_lints(- "Clarifying virtualenv 20's -p behavior",- PluralDecades::default(),- );+ assert_no_lints("Clarifying virtualenv 20's -p behavior", test_linter());}#[test]#[ignore = "wip"]fn dont_flag_hyphenated_version_numbers_soi_20() {- assert_no_lints("View soi-20's full-sized avatar.", PluralDecades::default());+ assert_no_lints("View soi-20's full-sized avatar.", test_linter());}#[test]fn dont_flag_cpp20s_concepts() {assert_no_lints("Replace SFINAE with C++20's Concepts and Constraints",- PluralDecades::default(),+ test_linter(),);}@@ -353,7 +353,7 @@ mod lints {fn dont_flag_cpp20s_std_latch() {assert_no_lints("As part of an experiment I recently switched from ducc's latch class to C++20's std::latch, and to my surprise I noticed a significant speedup",- PluralDecades::default(),+ test_linter(),);}@@ -362,24 +362,21 @@ mod lints {fn dont_flag_team_20s_application() {assert_no_lints("Team 20's application for the 2020 Teens In AI Global COVID Hackathon.",- PluralDecades::default(),+ test_linter(),);}#[test]#[ignore = "should we detect lesson numbers?"]fn dont_flag_lesson_20s_sql_query() {- assert_no_lints(- "Lesson 20's SQL Query is too inefficient",- PluralDecades::default(),- );+ assert_no_lints("Lesson 20's SQL Query is too inefficient", test_linter());}#[test]fn dont_flag_cpp20s_initialization_change() {assert_no_lints("Potential issue with C++20's initialization change.",- PluralDecades::default(),+ test_linter(),);}@@ -387,7 +384,7 @@ mod lints {fn fix_my_20s() {assert_suggestion_result("Just a software engineer in his 20's.",- PluralDecades::default(),+ test_linter(),"Just a software engineer in his 20s.",);}@@ -396,7 +393,7 @@ mod lints {fn fix_my_early_20s() {assert_suggestion_result("Thank you Steve Wozniak :-) it was the dream machine of my early 20's.",- PluralDecades::default(),+ test_linter(),"Thank you Steve Wozniak :-) it was the dream machine of my early 20s.",);}@@ -405,7 +402,7 @@ mod lints {fn fix_my_late_20s() {assert_suggestion_result("I only decided that I wanted to work in the field at my late 20's when I chose a graduation course",- PluralDecades::default(),+ test_linter(),"I only decided that I wanted to work in the field at my late 20s when I chose a graduation course",);}@@ -417,7 +414,7 @@ mod lints {fn dont_flag_sdk_versions() {assert_no_lints("binder: We call SDK 30's bindServiceAsUser() and SDK 26's bindDeviceAdminServiceAsUser() methods without a runtime check",- PluralDecades::default(),+ test_linter(),);}@@ -426,7 +423,7 @@ mod lints {fn dont_flag_jxn_hyphen_30s_username() {assert_no_lints("GitHub Gist: star and fork jxn-30's gists by creating an account on GitHub",- PluralDecades::default(),+ test_linter(),);}@@ -434,7 +431,7 @@ mod lints {fn fix_my_30s() {assert_suggestion_result("I'm a developer in my 30's.",- PluralDecades::default(),+ test_linter(),"I'm a developer in my 30s.",);}@@ -443,7 +440,7 @@ mod lints {fn fix_my_mid_30s() {assert_suggestion_result("Today, in my mid 30's, I am proficient in a wide range of programming languages and environments.",- PluralDecades::default(),+ test_linter(),"Today, in my mid 30s, I am proficient in a wide range of programming languages and environments.",);}@@ -452,7 +449,7 @@ mod lints {fn fix_my_early_30s() {assert_suggestion_result("Software Developer in my early 30's.",- PluralDecades::default(),+ test_linter(),"Software Developer in my early 30s.",);}@@ -462,14 +459,14 @@ mod lints {#[test]#[ignore = "might be too ambiguous to detect?"]fn dont_flag_group_40s() {- assert_no_lints("Group 40's team maths game.", PluralDecades::default());+ assert_no_lints("Group 40's team maths game.", test_linter());}#[test]fn fix_my_40s() {assert_suggestion_result("I'm a married father of two in my 40's who currently programs at work by day, and, well, at home by night.",- PluralDecades::default(),+ test_linter(),"I'm a married father of two in my 40s who currently programs at work by day, and, well, at home by night.",);}@@ -478,7 +475,7 @@ mod lints {fn fix_their_40s() {assert_suggestion_result("for a person in their 40's you're awfully bitter",- PluralDecades::default(),+ test_linter(),"for a person in their 40s you're awfully bitter",);}@@ -487,7 +484,7 @@ mod lints {fn fix_my_mid_40s() {assert_suggestion_result("I am a system developer in my mid 40's working in the health care sector at DNV Imatis AS.",- PluralDecades::default(),+ test_linter(),"I am a system developer in my mid 40s working in the health care sector at DNV Imatis AS.",);}@@ -496,7 +493,7 @@ mod lints {fn fix_their_mid_40s() {assert_suggestion_result("even my parents who are in their mid-40's can manage to use the default interface",- PluralDecades::default(),+ test_linter(),"even my parents who are in their mid-40s can manage to use the default interface",);}@@ -506,7 +503,7 @@ mod lints {#[test]#[ignore = "here it's a username but Harper has no way to know"]fn dont_flag_50s_username() {- assert_no_lints("View 50's full-sized avatar.", PluralDecades::default());+ assert_no_lints("View 50's full-sized avatar.", test_linter());}// 60s@@ -514,14 +511,14 @@ mod lints {#[test]#[ignore = "here it means 60+ seconds"]fn dont_flag_60_seconds() {- assert_no_lints("WSL cold startup 60's +", PluralDecades::default());+ assert_no_lints("WSL cold startup 60's +", test_linter());}#[test]fn fix_my_late_60s() {assert_suggestion_result("Comment: i'm a white woman in my late 60's and believe me, they are not too crazy about me",- PluralDecades::default(),+ test_linter(),"Comment: i'm a white woman in my late 60s and believe me, they are not too crazy about me",);}@@ -533,7 +530,7 @@ mod lints {fn dont_flag_dotnet_runtime_70s() {assert_no_lints("dotnet-runtime-70's release of 16th of May is causing \"version `GLIBC_2.34' not found\"",- PluralDecades::default(),+ test_linter(),);}@@ -541,7 +538,7 @@ mod lints {fn fix_late_hyphen_70s() {assert_suggestion_result("Retrocomputer built from late-70's TTL logic chips",- PluralDecades::default(),+ test_linter(),"Retrocomputer built from late-'70s TTL logic chips",);}@@ -551,7 +548,7 @@ mod lints {fn fix_a_fun_70s_industrial() {assert_suggestion_result("A fun 70's industrial \"launch\" control panel with a Yubikey key switch",- PluralDecades::default(),+ test_linter(),"A fun '70s industrial \"launch\" control panel with a Yubikey key switch",);}@@ -562,7 +559,7 @@ mod lints {fn fix_of_the_80s_npsg() {assert_suggestion_result("A reboot of the 80's Microwriter accessible chord keyboard done using an Arduino.",- PluralDecades::default(),+ test_linter(),"A reboot of the '80s Microwriter accessible chord keyboard done using an Arduino.",);}@@ -572,7 +569,7 @@ mod lints {fn fix_an_80s_npsg() {assert_suggestion_result("A remake of an 80's card game classic \"Around the World\"",- PluralDecades::default(),+ test_linter(),"A remake of an '80s card game classic \"Around the World\"",);}@@ -581,7 +578,7 @@ mod lints {fn fix_the_80s_npsg() {assert_suggestion_result("Small remake of the 80's legendary paperboy arcade game",- PluralDecades::default(),+ test_linter(),"Small remake of the '80s legendary paperboy arcade game",);}@@ -590,7 +587,7 @@ mod lints {fn fix_the_80s_style_game_breakout() {assert_suggestion_result("I called this pong but then was reminded that it more closely resembles the 80's style game Breakout.",- PluralDecades::default(),+ test_linter(),"I called this pong but then was reminded that it more closely resembles the '80s style game Breakout.",);}@@ -599,7 +596,7 @@ mod lints {fn fix_the_80s_microwriter() {assert_suggestion_result("A reboot of the 80's Microwriter accessible chord keyboard done using an Arduino.",- PluralDecades::default(),+ test_linter(),"A reboot of the '80s Microwriter accessible chord keyboard done using an Arduino.",);}@@ -609,7 +606,7 @@ mod lints {fn fix_80s_neon_theme() {assert_suggestion_result("A flat, 80's neon inspired theme for JupyterLab.",- PluralDecades::default(),+ test_linter(),"A flat, '80s neon inspired theme for JupyterLab.",);}@@ -619,7 +616,7 @@ mod lints {fn fix_80s_neon_theme_colors() {assert_suggestion_result("Cool UI Theme for Atom based on 80's neon colors with big tabs for easy files Switch.",- PluralDecades::default(),+ test_linter(),"Cool UI Theme for Atom based on '80s neon colors with big tabs for easy files Switch.",);}@@ -629,7 +626,7 @@ mod lints {fn fix_80s_synthwave_theme() {assert_suggestion_result("An clean 80's synthwave / outrun inspired theme for Vim.",- PluralDecades::default(),+ test_linter(),"An clean '80s synthwave / outrun inspired theme for Vim.",);}@@ -639,7 +636,7 @@ mod lints {fn fix_80s_3d_era() {assert_suggestion_result("Experimenting with writing 80's era 3D code but in Javascript and with HTML5 Canvas acting as display buffer.",- PluralDecades::default(),+ test_linter(),"Experimenting with writing '80s era 3D code but in Javascript and with HTML5 Canvas acting as display buffer.",);}@@ -649,7 +646,7 @@ mod lints {fn fix_80s_theme_80s_aesthetics() {assert_suggestion_result("Vibrant 80's Klipper Mainsail Theme, based around 80's Dark Neon Aesthetics.",- PluralDecades::default(),+ test_linter(),"Vibrant '80s Klipper Mainsail Theme, based around '80s Dark Neon Aesthetics.",);}@@ -659,7 +656,7 @@ mod lints {fn fix_80s_dark_retro_theme() {assert_suggestion_result("80's dark retro theme for VS Code and Sublime Text",- PluralDecades::default(),+ test_linter(),"'80s dark retro theme for VS Code and Sublime Text",);}@@ -668,7 +665,7 @@ mod lints {fn fix_80s_chorus_effect() {assert_suggestion_result("An 80's style chorus effect for your KORG 'logue synthesizers - hammondeggs/hera.",- PluralDecades::default(),+ test_linter(),"An '80s style chorus effect for your KORG 'logue synthesizers - hammondeggs/hera.",);}@@ -678,7 +675,7 @@ mod lints {fn dont_flag_chrome_80s() {assert_no_lints("Ready for Chrome 80's [Cookies default to SameSite=Lax] ?",- PluralDecades::default(),+ test_linter(),);}@@ -686,7 +683,7 @@ mod lints {fn fix_80s_style() {assert_suggestion_result("Made your RStudio 80's style only after the sun goes down.",- PluralDecades::default(),+ test_linter(),"Made your RStudio '80s style only after the sun goes down.",);}@@ -695,7 +692,7 @@ mod lints {fn fix_early_80s() {assert_suggestion_result("Hardware and a game for the early 80's Z8671 MCU with built-in BASIC",- PluralDecades::default(),+ test_linter(),"Hardware and a game for the early '80s Z8671 MCU with built-in BASIC",);}@@ -705,7 +702,7 @@ mod lints {fn fix_modest_80s_fighter_game() {assert_suggestion_result("An attempt by the MEGA65 community to write a modest 80's fighter game with BASIC 65 + Eleven",- PluralDecades::default(),+ test_linter(),"An attempt by the MEGA65 community to write a modest '80s fighter game with BASIC 65 + Eleven",);}@@ -715,7 +712,7 @@ mod lints {fn fix_straight_from_80s() {assert_suggestion_result("Straight from 80's",- PluralDecades::default(),+ test_linter(),"Straight from the '80s",);}@@ -727,7 +724,7 @@ mod lints {fn fix_the_90s_were() {assert_suggestion_result("Generate animated vector graphics for old-school 90's demos, like ST_NICCC",- PluralDecades::default(),+ test_linter(),"Generate animated vector graphics for old-school '90s demos, like ST_NICCC",);}@@ -737,7 +734,7 @@ mod lints {fn fix_late_90s() {assert_suggestion_result("gmdrec is a USB interface between your late 90's Sony portable MiniDisc recorder and your PC.",- PluralDecades::default(),+ test_linter(),"gmdrec is a USB interface between your late '90s Sony portable MiniDisc recorder and your PC.",);}@@ -746,7 +743,7 @@ mod lints {fn fix_the_90s_npsg() {assert_suggestion_result("A modern vision on the 90's game Log!cal.",- PluralDecades::default(),+ test_linter(),"A modern vision on the '90s game Log!cal.",);}@@ -755,7 +752,7 @@ mod lints {fn fix_from_the_90s() {assert_suggestion_result("Digital Sound and Music Interface (from the 90's).",- PluralDecades::default(),+ test_linter(),"Digital Sound and Music Interface (from the '90s).",);}@@ -764,7 +761,7 @@ mod lints {fn fix_the_late_90s() {assert_suggestion_result("A modified CircleMUD that ran in the late 90's.",- PluralDecades::default(),+ test_linter(),"A modified CircleMUD that ran in the late '90s.",);}@@ -774,7 +771,7 @@ mod lints {fn fix_rad_90s_website() {assert_suggestion_result("This is our rad 90's website.",- PluralDecades::default(),+ test_linter(),"This is our rad '90s website.",);}@@ -785,7 +782,7 @@ mod lints {// We could 'half-fix' just the 90's -> '90s part ...assert_suggestion_result("\"ワープロ明朝\" is a font that reproduced the smoothing algorithm used in the 80-90's Japanese word processors.",- PluralDecades::default(),+ test_linter(),"\"ワープロ明朝\" is a font that reproduced the smoothing algorithm used in the 80s-'90s Japanese word processors.",);}@@ -795,7 +792,7 @@ mod lints {fn dont_flag_all_90_degrees() {assert_no_lints("get_map(\"Slope Degrees\") returns all 90's unless projected crs is specified",- PluralDecades::default(),+ test_linter(),);}@@ -804,7 +801,7 @@ mod lints {fn fix_a_90s_workstation() {assert_suggestion_result("a 90's workstation; now likely too small",- PluralDecades::default(),+ test_linter(),"a '90s workstation; now likely too small",);}@@ -813,7 +810,7 @@ mod lints {fn fix_domains_in_the_90s() {assert_suggestion_result("Whois for gems, because gem names are like domains in the 90's",- PluralDecades::default(),+ test_linter(),"Whois for gems, because gem names are like domains in the '90s",);}@@ -823,7 +820,7 @@ mod lints {fn fix_the_classic_90s_game() {assert_suggestion_result("Dragon Court, the classic 90's game by Fred Haslam",- PluralDecades::default(),+ test_linter(),"Dragon Court, the classic '90s game by Fred Haslam",);}@@ -835,7 +832,7 @@ mod lints {fn fix_multiple_ages() {assert_suggestion_result("It generates 100,000 random \"people\" and randomly assigns them as being in their 20's, 30's, 40's, 50's, 60's, or 70's.",- PluralDecades::default(),+ test_linter(),"It generates 100,000 random \"people\" and randomly assigns them as being in their 20s, 30s, 40s, 50s, 60s, or 70s.",);}@@ -845,7 +842,7 @@ mod lints {fn fix_missing_the() {assert_suggestion_result("A thoughtful full-stack reimplementation of gaming in 80's and 90's.",- PluralDecades::default(),+ test_linter(),"A thoughtful full-stack reimplementation of gaming in the '80s and '90s.",);}@@ -855,7 +852,7 @@ mod lints {fn fix_my_20s_and_30s() {assert_suggestion_result("I spend my 20's and 30's as an officer with Royal Caribbean Cruises",- PluralDecades::default(),+ test_linter(),"I spend my 20s and 30s as an officer with Royal Caribbean Cruises",);}diff --git a/harper-core/src/linting/pooled_linter/mod.rs b/harper-core/src/linting/pooled_linter/mod.rsnew file mode 100644index 000000000..6c12cd393--- /dev/null+++ b/harper-core/src/linting/pooled_linter/mod.rs@@ -0,0 +1,92 @@+#[cfg(feature = "concurrent")]+mod multi_thread_pool;+mod pool;+mod single_thread_pool;++use self::pool::Pool;+#[cfg(not(feature = "concurrent"))]+use self::single_thread_pool::SingleThreadPool;+use crate::Lint;++use super::Linter;++#[cfg(feature = "concurrent")]+type SelectedPool<T> = multi_thread_pool::MultiThreadPool<T>;+#[cfg(not(feature = "concurrent"))]+type SelectedPool<T> = SingleThreadPool<T>;++/// A `PooledLinter` is a data structure that wraps around a [`Linter`] constructor.+///+/// When the `concurrent` feature is enabled, it uses the provided constructor function to create a+/// pool of child linters. This pool exists so a thread pool can perform linting operations+/// without needing to repeatedly construct or otherwise manage linters. When a linter is needed, an+/// unlocked linter from the pool is borrowed, the linting is performed, then it is released back to+/// the pool. If there are no available linters in the pool, one is added. The pool will rarely, if+/// ever, have more than N elements in it, where N is the number of CPUs available to the program.+///+///+/// When the `concurrent` feature is _disabled_, no pool is instantiated. Instead, a new linter+/// will be constructed for each call. This is understandably quite expensive, so if you intend to+/// use this data structure, it's highly recommended that you enable `concurrent`+pub struct PooledLinter<L: Linter> {+ pool: SelectedPool<L>,+ description: String,+}++impl<L: Linter> PooledLinter<L> {+ pub fn new(ctor: fn() -> L) -> Self {+ let pool = SelectedPool::new(ctor);+ let description = pool.run_with_pool(|i| i.description().to_string());++ Self { pool, description }+ }++ pub fn run_with_inner<B>(&self, callback: impl FnOnce(&mut L) -> B) -> B {+ self.pool.run_with_pool(callback)+ }+}++impl<L: Linter> Linter for PooledLinter<L> {+ fn lint(&mut self, document: &crate::Document) -> Vec<Lint> {+ self.run_with_inner(|linter| linter.lint(document))+ }++ fn description(&self) -> &str {+ &self.description+ }+}++impl<L: Linter> Clone for PooledLinter<L> {+ fn clone(&self) -> Self {+ Self {+ pool: self.pool.clone(),+ description: self.description.clone(),+ }+ }+}++#[cfg(test)]+pub mod for_tests {+ /// Constructs a static `PooledLinter` for use in tests. Provide the name of the linter under+ /// test, its type, and an expression to construct it.+ macro_rules! create_test_pool {+ ($linter_name:ident, $linter_ty:ty, $linter_ctor:expr) => {+ mod test_group_container {+ use super::$linter_name;+ #[allow(unused_imports)]+ use super::*;+ use crate::linting::PooledLinter;+ use std::sync::LazyLock;++ pub static TEST_GROUP: LazyLock<PooledLinter<$linter_ty>> =+ LazyLock::new(|| PooledLinter::new(|| $linter_ctor));+ }++ fn test_linter() -> crate::linting::PooledLinter<$linter_ty> {+ (*test_group_container::TEST_GROUP).clone()+ }+ };+ }++ pub(crate) use create_test_pool;+}diff --git a/harper-core/src/linting/pooled_linter/multi_thread_pool.rs b/harper-core/src/linting/pooled_linter/multi_thread_pool.rsnew file mode 100644index 000000000..954f9e6b0--- /dev/null+++ b/harper-core/src/linting/pooled_linter/multi_thread_pool.rs@@ -0,0 +1,50 @@+use boxcar::Vec;+use std::sync::{Arc, Mutex};++use super::pool::Pool;++pub struct MultiThreadPool<T> {+ ctor: fn() -> T,+ pool: Arc<Vec<Mutex<T>>>,+}++impl<T> Pool<T> for MultiThreadPool<T> {+ fn new(ctor: fn() -> T) -> Self {+ let first = ctor();+ let pool = Vec::new();+ pool.push(Mutex::new(first));++ Self {+ pool: Arc::new(pool),+ ctor,+ }+ }++ /// Run a callback with access to a member of the pool.+ fn run_with_pool<B, C: FnOnce(&mut T) -> B>(&self, callback: C) -> B {+ // Attempt to grab an open copy.+ {+ for (_, item) in self.pool.iter() {+ if let Ok(mut l) = item.try_lock() {+ return callback(&mut l);+ }+ }+ }++ let mut new_item = (self.ctor)();+ let result = callback(&mut new_item);++ self.pool.push(Mutex::new(new_item));++ result+ }+}++impl<T> Clone for MultiThreadPool<T> {+ fn clone(&self) -> Self {+ Self {+ ctor: self.ctor,+ pool: self.pool.clone(),+ }+ }+}diff --git a/harper-core/src/linting/pooled_linter/pool.rs b/harper-core/src/linting/pooled_linter/pool.rsnew file mode 100644index 000000000..942599225--- /dev/null+++ b/harper-core/src/linting/pooled_linter/pool.rs@@ -0,0 +1,4 @@+pub trait Pool<T>: Clone {+ fn new(ctor: fn() -> T) -> Self;+ fn run_with_pool<B, C: FnOnce(&mut T) -> B>(&self, callback: C) -> B;+}diff --git a/harper-core/src/linting/pooled_linter/single_thread_pool.rs b/harper-core/src/linting/pooled_linter/single_thread_pool.rsnew file mode 100644index 000000000..2a7e1539f--- /dev/null+++ b/harper-core/src/linting/pooled_linter/single_thread_pool.rs@@ -0,0 +1,22 @@+use super::pool::Pool;++pub struct SingleThreadPool<T> {+ ctor: fn() -> T,+}++impl<T> Pool<T> for SingleThreadPool<T> {+ fn new(ctor: fn() -> T) -> Self {+ Self { ctor }+ }++ fn run_with_pool<B, C: FnOnce(&mut T) -> B>(&self, callback: C) -> B {+ let mut item = (self.ctor)();+ callback(&mut item)+ }+}++impl<T> Clone for SingleThreadPool<T> {+ fn clone(&self) -> Self {+ Self { ctor: self.ctor }+ }+}diff --git a/harper-core/src/linting/progressive_needs_be.rs b/harper-core/src/linting/progressive_needs_be.rsindex 414014728..3385eac5f 100644--- a/harper-core/src/linting/progressive_needs_be.rs+++ b/harper-core/src/linting/progressive_needs_be.rs@@ -92,6 +92,13 @@ impl ExprLinter for ProgressiveNeedsBe {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(+ ProgressiveNeedsBe,+ ProgressiveNeedsBe,+ ProgressiveNeedsBe::default()+ );use super::ProgressiveNeedsBe;use crate::linting::tests::{assert_good_and_bad_suggestions, assert_lint_count, assert_suggestion_result,@@ -101,7 +108,7 @@ mod tests {fn suggests_im_looking() {assert_suggestion_result("I've looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm looking into it.",);}@@ -110,7 +117,7 @@ mod tests {fn corrects_basic_im() {assert_suggestion_result("I've looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm looking into it.",);}@@ -119,7 +126,7 @@ mod tests {fn offers_both_suggestions() {assert_good_and_bad_suggestions("I've looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),&["I'm looking into it.", "I've been looking into it."],&[],);@@ -127,42 +134,34 @@ mod tests {#[test]fn allows_ive_looked() {- assert_lint_count("I've looked into it.", ProgressiveNeedsBe::default(), 0);+ assert_lint_count("I've looked into it.", test_linter(), 0);}#[test]fn allows_ive_been_looking() {- assert_lint_count(- "I've been looking into it.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("I've been looking into it.", test_linter(), 0);}#[test]fn allows_ive_seen() {- assert_lint_count("I've seen the results.", ProgressiveNeedsBe::default(), 0);+ assert_lint_count("I've seen the results.", test_linter(), 0);}#[test]fn allows_ive_long_been_looking() {- assert_lint_count(- "I've long been looking into it.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("I've long been looking into it.", test_linter(), 0);}#[test]fn no_match_with_punctuation_between() {- assert_lint_count("I've, looking into it.", ProgressiveNeedsBe::default(), 0);+ assert_lint_count("I've, looking into it.", test_linter(), 0);}#[test]fn handles_newline_whitespace() {assert_suggestion_result("I've\nlooking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm\nlooking into it.",);}@@ -171,7 +170,7 @@ mod tests {fn capitalization_all_caps_base() {assert_suggestion_result("I'VE looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'M looking into it.",);}@@ -180,7 +179,7 @@ mod tests {fn works_for_weve() {assert_suggestion_result("We've looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're looking into it.",);}@@ -189,7 +188,7 @@ mod tests {fn suggests_im_looking_non_contracted() {assert_suggestion_result("I have looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm looking into it.",);}@@ -198,7 +197,7 @@ mod tests {fn offers_both_suggestions_non_contracted() {assert_good_and_bad_suggestions("They have looking into it.",- ProgressiveNeedsBe::default(),+ test_linter(),&["They're looking into it.","They have been looking into it.",@@ -209,16 +208,12 @@ mod tests {#[test]fn allows_i_have_been_looking() {- assert_lint_count(- "I have been looking into it.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("I have been looking into it.", test_linter(), 0);}#[test]fn allows_i_have_looked() {- assert_lint_count("I have looked into it.", ProgressiveNeedsBe::default(), 0);+ assert_lint_count("I have looked into it.", test_linter(), 0);}// Additional generalized cases@@ -227,7 +222,7 @@ mod tests {fn ive_working() {assert_suggestion_result("I've working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm working on it today.",);}@@ -235,7 +230,7 @@ mod tests {fn weve_working() {assert_suggestion_result("We've working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're working on it today.",);}@@ -243,7 +238,7 @@ mod tests {fn youve_working() {assert_suggestion_result("You've working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're working on it today.",);}@@ -251,7 +246,7 @@ mod tests {fn theyve_working() {assert_suggestion_result("They've working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're working on it today.",);}@@ -260,7 +255,7 @@ mod tests {fn ive_eating() {assert_suggestion_result("I've eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm eating it today.",);}@@ -268,7 +263,7 @@ mod tests {fn weve_eating() {assert_suggestion_result("We've eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're eating it today.",);}@@ -276,7 +271,7 @@ mod tests {fn youve_eating() {assert_suggestion_result("You've eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're eating it today.",);}@@ -284,7 +279,7 @@ mod tests {fn theyve_eating() {assert_suggestion_result("They've eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're eating it today.",);}@@ -293,7 +288,7 @@ mod tests {fn ive_reading() {assert_suggestion_result("I've reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm reading it today.",);}@@ -301,7 +296,7 @@ mod tests {fn weve_reading() {assert_suggestion_result("We've reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're reading it today.",);}@@ -309,7 +304,7 @@ mod tests {fn youve_reading() {assert_suggestion_result("You've reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're reading it today.",);}@@ -317,7 +312,7 @@ mod tests {fn theyve_reading() {assert_suggestion_result("They've reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're reading it today.",);}@@ -326,7 +321,7 @@ mod tests {fn ive_writing() {assert_suggestion_result("I've writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm writing it today.",);}@@ -334,7 +329,7 @@ mod tests {fn weve_writing() {assert_suggestion_result("We've writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're writing it today.",);}@@ -342,7 +337,7 @@ mod tests {fn youve_writing() {assert_suggestion_result("You've writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're writing it today.",);}@@ -350,7 +345,7 @@ mod tests {fn theyve_writing() {assert_suggestion_result("They've writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're writing it today.",);}@@ -359,7 +354,7 @@ mod tests {fn ive_speaking() {assert_suggestion_result("I've speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm speaking about it today.",);}@@ -367,7 +362,7 @@ mod tests {fn weve_speaking() {assert_suggestion_result("We've speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're speaking about it today.",);}@@ -375,7 +370,7 @@ mod tests {fn youve_speaking() {assert_suggestion_result("You've speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're speaking about it today.",);}@@ -383,7 +378,7 @@ mod tests {fn theyve_speaking() {assert_suggestion_result("They've speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're speaking about it today.",);}@@ -392,7 +387,7 @@ mod tests {fn ive_studying() {assert_suggestion_result("I've studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm studying it today.",);}@@ -400,7 +395,7 @@ mod tests {fn weve_studying() {assert_suggestion_result("We've studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're studying it today.",);}@@ -408,7 +403,7 @@ mod tests {fn youve_studying() {assert_suggestion_result("You've studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're studying it today.",);}@@ -416,7 +411,7 @@ mod tests {fn theyve_studying() {assert_suggestion_result("They've studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're studying it today.",);}@@ -425,7 +420,7 @@ mod tests {fn ive_testing() {assert_suggestion_result("I've testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm testing it today.",);}@@ -433,7 +428,7 @@ mod tests {fn weve_testing() {assert_suggestion_result("We've testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're testing it today.",);}@@ -441,7 +436,7 @@ mod tests {fn youve_testing() {assert_suggestion_result("You've testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're testing it today.",);}@@ -449,24 +444,20 @@ mod tests {fn theyve_testing() {assert_suggestion_result("They've testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're testing it today.",);}#[test]fn ive_using() {- assert_suggestion_result(- "I've using it today.",- ProgressiveNeedsBe::default(),- "I'm using it today.",- );+ assert_suggestion_result("I've using it today.", test_linter(), "I'm using it today.");}#[test]fn weve_using() {assert_suggestion_result("We've using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're using it today.",);}@@ -474,7 +465,7 @@ mod tests {fn youve_using() {assert_suggestion_result("You've using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're using it today.",);}@@ -482,7 +473,7 @@ mod tests {fn theyve_using() {assert_suggestion_result("They've using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're using it today.",);}@@ -492,7 +483,7 @@ mod tests {fn i_have_working() {assert_suggestion_result("I have working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm working on it today.",);}@@ -500,7 +491,7 @@ mod tests {fn we_have_working() {assert_suggestion_result("We have working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're working on it today.",);}@@ -508,7 +499,7 @@ mod tests {fn you_have_working() {assert_suggestion_result("You have working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're working on it today.",);}@@ -516,7 +507,7 @@ mod tests {fn they_have_working() {assert_suggestion_result("They have working on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're working on it today.",);}@@ -525,7 +516,7 @@ mod tests {fn i_have_eating() {assert_suggestion_result("I have eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm eating it today.",);}@@ -533,7 +524,7 @@ mod tests {fn we_have_eating() {assert_suggestion_result("We have eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're eating it today.",);}@@ -541,7 +532,7 @@ mod tests {fn you_have_eating() {assert_suggestion_result("You have eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're eating it today.",);}@@ -549,7 +540,7 @@ mod tests {fn they_have_eating() {assert_suggestion_result("They have eating it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're eating it today.",);}@@ -558,7 +549,7 @@ mod tests {fn i_have_reading() {assert_suggestion_result("I have reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm reading it today.",);}@@ -566,7 +557,7 @@ mod tests {fn we_have_reading() {assert_suggestion_result("We have reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're reading it today.",);}@@ -574,7 +565,7 @@ mod tests {fn you_have_reading() {assert_suggestion_result("You have reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're reading it today.",);}@@ -582,7 +573,7 @@ mod tests {fn they_have_reading() {assert_suggestion_result("They have reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're reading it today.",);}@@ -591,7 +582,7 @@ mod tests {fn i_have_writing() {assert_suggestion_result("I have writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm writing it today.",);}@@ -599,7 +590,7 @@ mod tests {fn we_have_writing() {assert_suggestion_result("We have writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're writing it today.",);}@@ -607,7 +598,7 @@ mod tests {fn you_have_writing() {assert_suggestion_result("You have writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're writing it today.",);}@@ -615,7 +606,7 @@ mod tests {fn they_have_writing() {assert_suggestion_result("They have writing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're writing it today.",);}@@ -624,7 +615,7 @@ mod tests {fn i_have_speaking() {assert_suggestion_result("I have speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm speaking about it today.",);}@@ -632,7 +623,7 @@ mod tests {fn we_have_speaking() {assert_suggestion_result("We have speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're speaking about it today.",);}@@ -640,7 +631,7 @@ mod tests {fn you_have_speaking() {assert_suggestion_result("You have speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're speaking about it today.",);}@@ -648,7 +639,7 @@ mod tests {fn they_have_speaking() {assert_suggestion_result("They have speaking about it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're speaking about it today.",);}@@ -657,7 +648,7 @@ mod tests {fn i_have_studying() {assert_suggestion_result("I have studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm studying it today.",);}@@ -665,7 +656,7 @@ mod tests {fn we_have_studying() {assert_suggestion_result("We have studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're studying it today.",);}@@ -673,7 +664,7 @@ mod tests {fn you_have_studying() {assert_suggestion_result("You have studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're studying it today.",);}@@ -681,7 +672,7 @@ mod tests {fn they_have_studying() {assert_suggestion_result("They have studying it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're studying it today.",);}@@ -690,7 +681,7 @@ mod tests {fn i_have_testing() {assert_suggestion_result("I have testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm testing it today.",);}@@ -698,7 +689,7 @@ mod tests {fn we_have_testing() {assert_suggestion_result("We have testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're testing it today.",);}@@ -706,7 +697,7 @@ mod tests {fn you_have_testing() {assert_suggestion_result("You have testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're testing it today.",);}@@ -714,7 +705,7 @@ mod tests {fn they_have_testing() {assert_suggestion_result("They have testing it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're testing it today.",);}@@ -723,7 +714,7 @@ mod tests {fn i_have_using() {assert_suggestion_result("I have using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm using it today.",);}@@ -731,7 +722,7 @@ mod tests {fn we_have_using() {assert_suggestion_result("We have using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're using it today.",);}@@ -739,7 +730,7 @@ mod tests {fn you_have_using() {assert_suggestion_result("You have using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"You're using it today.",);}@@ -747,7 +738,7 @@ mod tests {fn they_have_using() {assert_suggestion_result("They have using it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"They're using it today.",);}@@ -757,7 +748,7 @@ mod tests {fn both_suggestions_ive_working() {assert_good_and_bad_suggestions("I've working today.",- ProgressiveNeedsBe::default(),+ test_linter(),&["I'm working today.", "I've been working today."],&[],);@@ -766,7 +757,7 @@ mod tests {fn both_suggestions_we_have_reading() {assert_good_and_bad_suggestions("We have reading it today.",- ProgressiveNeedsBe::default(),+ test_linter(),&["We're reading it today.", "We have been reading it today."],&[],);@@ -775,7 +766,7 @@ mod tests {fn both_suggestions_youve_reading() {assert_good_and_bad_suggestions("You've reading today.",- ProgressiveNeedsBe::default(),+ test_linter(),&["You're reading today.", "You've been reading today."],&[],);@@ -784,7 +775,7 @@ mod tests {fn both_suggestions_they_have_writing() {assert_good_and_bad_suggestions("They have writing today.",- ProgressiveNeedsBe::default(),+ test_linter(),&["They're writing today.", "They have been writing today."],&[],);@@ -792,58 +783,38 @@ mod tests {// Non-match and allowed-form checksfn no_match_punctuation_contracted() {- assert_lint_count("I've, working today.", ProgressiveNeedsBe::default(), 0);+ assert_lint_count("I've, working today.", test_linter(), 0);}#[test]fn no_match_punctuation_non_contracted() {- assert_lint_count("I have, working today.", ProgressiveNeedsBe::default(), 0);+ assert_lint_count("I have, working today.", test_linter(), 0);}#[test]fn no_match_adverb_interruption() {- assert_lint_count(- "I have quickly working today.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("I have quickly working today.", test_linter(), 0);}#[test]fn allowed_contracted_have_been() {- assert_lint_count(- "You've been studying today.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("You've been studying today.", test_linter(), 0);}#[test]fn allowed_non_contracted_have_been() {- assert_lint_count(- "You have been studying today.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("You have been studying today.", test_linter(), 0);}#[test]fn allowed_they_have_been() {- assert_lint_count(- "They have been testing today.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("They have been testing today.", test_linter(), 0);}#[test]fn allowed_theyve_been() {- assert_lint_count(- "They've been testing today.",- ProgressiveNeedsBe::default(),- 0,- );+ assert_lint_count("They've been testing today.", test_linter(), 0);}#[test]fn capitalization_variants_non_contracted() {assert_suggestion_result("WE HAVE working today.",- ProgressiveNeedsBe::default(),+ test_linter(),"WE'RE working today.",);}@@ -851,7 +822,7 @@ mod tests {fn newline_variants_non_contracted() {assert_suggestion_result("We have\nworking on it today.",- ProgressiveNeedsBe::default(),+ test_linter(),"We're\nworking on it today.",);}@@ -863,7 +834,7 @@ mod tests {fn test_ive_being() {assert_good_and_bad_suggestions("I've being playing with languages.toml",- ProgressiveNeedsBe::default(),+ test_linter(),&["I've been playing with languages.toml","I'm playing with languages.toml",@@ -876,7 +847,7 @@ mod tests {fn test_ive_doing_no_apostrophe() {assert_suggestion_result("Ive always seen the variables and debug into it, and thats what ive doing.",- ProgressiveNeedsBe::default(),+ test_linter(),"Ive always seen the variables and debug into it, and thats what i'm doing.",);}@@ -885,7 +856,7 @@ mod tests {fn test_ive_looking_no_apostrophe() {assert_suggestion_result("Ive looking for a way to get temperature and humidity for all of our rooms within for a reasonable price in Germany.",- ProgressiveNeedsBe::default(),+ test_linter(),"I'm looking for a way to get temperature and humidity for all of our rooms within for a reasonable price in Germany.",);}@@ -895,7 +866,7 @@ mod tests {fn test_youve_being() {assert_suggestion_result("Thanks for all the work you've being doing for this project btw!",- ProgressiveNeedsBe::default(),+ test_linter(),"Thanks for all the work you're doing for this project btw!",);}@@ -904,7 +875,7 @@ mod tests {fn test_theyve_doing() {assert_suggestion_result("it’s also kind of implied users read the documentation or generally have a sense of what they’ve doing and what could go wrong",- ProgressiveNeedsBe::default(),+ test_linter(),"it’s also kind of implied users read the documentation or generally have a sense of what they're doing and what could go wrong",);}diff --git a/harper-core/src/linting/pronoun_inflection_be.rs b/harper-core/src/linting/pronoun_inflection_be.rsindex 938510d99..eeaa5ee50 100644--- a/harper-core/src/linting/pronoun_inflection_be.rs+++ b/harper-core/src/linting/pronoun_inflection_be.rs@@ -169,6 +169,13 @@ impl ExprLinter for PronounInflectionBe {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(+ PronounInflectionBe,+ PronounInflectionBe,+ PronounInflectionBe::default()+ );use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};use super::PronounInflectionBe;@@ -177,7 +184,7 @@ mod tests {fn corrects_he_are() {assert_suggestion_result("He are my best friend.",- PronounInflectionBe::default(),+ test_linter(),"He is my best friend.",);}@@ -186,7 +193,7 @@ mod tests {fn corrects_she_are() {assert_suggestion_result("She are my best friend.",- PronounInflectionBe::default(),+ test_linter(),"She is my best friend.",);}@@ -195,109 +202,89 @@ mod tests {fn corrects_they_is() {assert_suggestion_result("They is my best friend.",- PronounInflectionBe::default(),+ test_linter(),"They are my best friend.",);}#[test]fn allows_they_are() {- assert_lint_count(- "They are my best friend.",- PronounInflectionBe::default(),- 0,- );+ assert_lint_count("They are my best friend.", test_linter(), 0);}#[test]fn corrects_it_are() {- assert_suggestion_result(- "It are on the table.",- PronounInflectionBe::default(),- "It is on the table.",- );+ assert_suggestion_result("It are on the table.", test_linter(), "It is on the table.");}#[test]fn corrects_he_are_negation() {- assert_suggestion_result(- "He are not amused.",- PronounInflectionBe::default(),- "He is not amused.",- );+ assert_suggestion_result("He are not amused.", test_linter(), "He is not amused.");}#[test]fn corrects_she_are_progressive() {assert_suggestion_result("She are going to win.",- PronounInflectionBe::default(),+ test_linter(),"She is going to win.",);}#[test]fn corrects_they_is_negation() {- assert_suggestion_result(- "They is not ready.",- PronounInflectionBe::default(),- "They are not ready.",- );+ assert_suggestion_result("They is not ready.", test_linter(), "They are not ready.");}#[test]fn corrects_they_is_progressive() {assert_suggestion_result("They is planning a trip.",- PronounInflectionBe::default(),+ test_linter(),"They are planning a trip.",);}#[test]fn allows_he_is() {- assert_lint_count("He is my best friend.", PronounInflectionBe::default(), 0);+ assert_lint_count("He is my best friend.", test_linter(), 0);}#[test]fn allows_she_is_lowercase() {- assert_lint_count("she is excited to go.", PronounInflectionBe::default(), 0);+ assert_lint_count("she is excited to go.", test_linter(), 0);}#[test]fn allows_it_is() {- assert_lint_count("It is what it is.", PronounInflectionBe::default(), 0);+ assert_lint_count("It is what it is.", test_linter(), 0);}#[test]fn allows_they_are_negation() {- assert_lint_count(- "They are not interested.",- PronounInflectionBe::default(),- 0,- );+ assert_lint_count("They are not interested.", test_linter(), 0);}#[test]fn allows_they_were() {- assert_lint_count("They were already here.", PronounInflectionBe::default(), 0);+ assert_lint_count("They were already here.", test_linter(), 0);}#[test]fn allows_asdf_is() {- assert_lint_count("asdf is not a word", PronounInflectionBe::default(), 0);+ assert_lint_count("asdf is not a word", test_linter(), 0);}#[test]fn no_subject() {- assert_lint_count("is set", PronounInflectionBe::default(), 0);+ assert_lint_count("is set", test_linter(), 0);}#[test]fn corrects_i_were() {assert_suggestion_result("I were the best player on the field.",- PronounInflectionBe::default(),+ test_linter(),"I was the best player on the field.",);}@@ -306,7 +293,7 @@ mod tests {fn corrects_we_was() {assert_suggestion_result("We was the best players on the field.",- PronounInflectionBe::default(),+ test_linter(),"We were the best players on the field.",);}@@ -315,116 +302,86 @@ mod tests {fn corrects_you_was() {assert_suggestion_result("You was my best friend.",- PronounInflectionBe::default(),+ test_linter(),"You were my best friend.",);}#[test]fn allows_you_were() {- assert_lint_count(- "You were my best friend.",- PronounInflectionBe::default(),- 0,- );+ assert_lint_count("You were my best friend.", test_linter(), 0);}#[test]fn corrects_he_were() {- assert_suggestion_result(- "He were late.",- PronounInflectionBe::default(),- "He was late.",- );+ assert_suggestion_result("He were late.", test_linter(), "He was late.");}#[test]fn corrects_they_was() {- assert_suggestion_result(- "They was on time.",- PronounInflectionBe::default(),- "They were on time.",- );+ assert_suggestion_result("They was on time.", test_linter(), "They were on time.");}#[test]fn allows_he_was() {- assert_lint_count("He was here.", PronounInflectionBe::default(), 0);+ assert_lint_count("He was here.", test_linter(), 0);}#[test]fn allows_we_were() {- assert_lint_count("We were excited.", PronounInflectionBe::default(), 0);+ assert_lint_count("We were excited.", test_linter(), 0);}#[test]fn corrects_he_arent() {- assert_suggestion_result(- "He aren't ready.",- PronounInflectionBe::default(),- "He isn't ready.",- );+ assert_suggestion_result("He aren't ready.", test_linter(), "He isn't ready.");}#[test]fn corrects_they_isnt() {- assert_suggestion_result(- "They isn't coming.",- PronounInflectionBe::default(),- "They aren't coming.",- );+ assert_suggestion_result("They isn't coming.", test_linter(), "They aren't coming.");}#[test]fn allows_he_isnt() {- assert_lint_count("He isn't ready.", PronounInflectionBe::default(), 0);+ assert_lint_count("He isn't ready.", test_linter(), 0);}#[test]fn allows_they_arent() {- assert_lint_count("They aren't coming.", PronounInflectionBe::default(), 0);+ assert_lint_count("They aren't coming.", test_linter(), 0);}#[test]fn corrects_she_really_are() {assert_suggestion_result("She really are talented.",- PronounInflectionBe::default(),+ test_linter(),"She really is talented.",);}#[test]fn corrects_they_often_is() {- assert_suggestion_result(- "They often is late.",- PronounInflectionBe::default(),- "They often are late.",- );+ assert_suggestion_result("They often is late.", test_linter(), "They often are late.");}#[test]fn corrects_because_he_are() {assert_suggestion_result("because he are tired.",- PronounInflectionBe::default(),+ test_linter(),"because he is tired.",);}#[test]fn allow_behind_him() {- assert_no_lints(- "Behind him are new shadows.",- PronounInflectionBe::default(),- );+ assert_no_lints("Behind him are new shadows.", test_linter());}#[test]fn issue_1682() {- assert_no_lints(- "Understanding them is significant",- PronounInflectionBe::default(),- );+ assert_no_lints("Understanding them is significant", test_linter());}}diff --git a/harper-core/src/linting/pronoun_verb_agreement.rs b/harper-core/src/linting/pronoun_verb_agreement.rsindex fdd3552bf..e2d9ec873 100644--- a/harper-core/src/linting/pronoun_verb_agreement.rs+++ b/harper-core/src/linting/pronoun_verb_agreement.rs@@ -244,62 +244,50 @@ impl<D: Dictionary> ExprLinter for PronounVerbAgreement<D> {#[cfg(test)]mod lints {use super::PronounVerbAgreement;+ use crate::linting::create_test_pool;use crate::linting::tests::{assert_no_lints, assert_suggestion_result};use crate::spell::FstDictionary;+ use std::sync::Arc;- // Expected to be fixed, but there are exceptions+ create_test_pool!(+ PronounVerbAgreement,+ PronounVerbAgreement<Arc<FstDictionary>>,+ PronounVerbAgreement::new(FstDictionary::curated())+ );#[test]fn issue_233_1() {- assert_suggestion_result(- "I likes this place.",- PronounVerbAgreement::new(FstDictionary::curated()),- "I like this place.",- );+ assert_suggestion_result("I likes this place.", test_linter(), "I like this place.");}#[test]fn issue_233_2() {- assert_suggestion_result(- "I sits under the AC.",- PronounVerbAgreement::new(FstDictionary::curated()),- "I sit under the AC.",- );+ assert_suggestion_result("I sits under the AC.", test_linter(), "I sit under the AC.");}#[test]#[ignore = "because 'like' is an adjective as well as a verb."]fn issue_233_1_reverse() {- assert_suggestion_result(- "He like this place.",- PronounVerbAgreement::new(FstDictionary::curated()),- "He likes this place.",- );+ assert_suggestion_result("He like this place.", test_linter(), "He likes this place.");}#[test]fn why_we_cant_flag_like_yet() {- assert_no_lints(- "What is he like?",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("What is he like?", test_linter());}#[test]fn issue_233_2_reverse() {assert_suggestion_result("She sit under the AC.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),"She sits under the AC.",);}#[test]fn dont_flag_correct_agreement() {- assert_no_lints(- "He likes this place. I sit under the AC.",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("He likes this place. I sit under the AC.", test_linter());}// Every pronoun systematically@@ -308,129 +296,84 @@ mod lints {#[test]fn fixes_i() {- assert_suggestion_result(- "I wakes up.",- PronounVerbAgreement::new(FstDictionary::curated()),- "I wake up.",- );+ assert_suggestion_result("I wakes up.", test_linter(), "I wake up.");}#[test]fn fixes_we() {- assert_suggestion_result(- "We gets dressed.",- PronounVerbAgreement::new(FstDictionary::curated()),- "We get dressed.",- );+ assert_suggestion_result("We gets dressed.", test_linter(), "We get dressed.");}#[test]fn fixes_you() {assert_suggestion_result("You drops off the kids.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),"You drop off the kids.",);}#[test]fn fixes_he() {- assert_suggestion_result(- "He work hard.",- PronounVerbAgreement::new(FstDictionary::curated()),- "He works hard.",- );+ assert_suggestion_result("He work hard.", test_linter(), "He works hard.");}#[test]fn fixes_she() {- assert_suggestion_result(- "She study hard.",- PronounVerbAgreement::new(FstDictionary::curated()),- "She studies hard.",- );+ assert_suggestion_result("She study hard.", test_linter(), "She studies hard.");}#[test]#[ignore = "Becasue 'it' is also object case. Eg. 'watch it break down'"]fn we_cant_fix_it_yet() {- assert_suggestion_result(- "It break down.",- PronounVerbAgreement::new(FstDictionary::curated()),- "It breaks down.",- );+ assert_suggestion_result("It break down.", test_linter(), "It breaks down.");}#[test]fn why_we_cant_fix_it_yet() {- assert_no_lints(- "I heard it break down.",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("I heard it break down.", test_linter());}#[test]fn fixes_they() {- assert_suggestion_result(- "They repairs it.",- PronounVerbAgreement::new(FstDictionary::curated()),- "They repair it.",- )+ assert_suggestion_result("They repairs it.", test_linter(), "They repair it.")}// Correct phrases that are expected not to get corrected#[test]fn dont_flag_i() {- assert_no_lints("I eat", PronounVerbAgreement::new(FstDictionary::curated()));+ assert_no_lints("I eat", test_linter());}#[test]fn dont_flag_we() {- assert_no_lints(- "We drink",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("We drink", test_linter());}#[test]fn dont_flag_you() {- assert_no_lints(- "You walk",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("You walk", test_linter());}#[test]fn dont_flag_he() {- assert_no_lints(- "He runs",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("He runs", test_linter());}#[test]fn dont_flag_she() {- assert_no_lints(- "She swims",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("She swims", test_linter());}#[test]fn dont_flag_it() {- assert_no_lints(- "It works!",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("It works!", test_linter());}#[test]fn dont_flag_they() {- assert_no_lints(- "They finish",- PronounVerbAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("They finish", test_linter());}// Ceck changing verb endings@@ -438,37 +381,21 @@ mod lints {// -ies ↔ -y#[test]fn fix_flies() {- assert_suggestion_result(- "I flies",- PronounVerbAgreement::new(FstDictionary::curated()),- "I fly",- );+ assert_suggestion_result("I flies", test_linter(), "I fly");}#[test]fn fix_cry() {- assert_suggestion_result(- "He cry",- PronounVerbAgreement::new(FstDictionary::curated()),- "He cries",- );+ assert_suggestion_result("He cry", test_linter(), "He cries");}// -o ↔ -oes#[test]fn fix_go() {- assert_suggestion_result(- "She go",- PronounVerbAgreement::new(FstDictionary::curated()),- "She goes",- );+ assert_suggestion_result("She go", test_linter(), "She goes");}#[test]fn fix_goes() {- assert_suggestion_result(- "They goes",- PronounVerbAgreement::new(FstDictionary::curated()),- "They go",- );+ assert_suggestion_result("They goes", test_linter(), "They go");}// Check irregular changes@@ -476,55 +403,31 @@ mod lints {// has ↔ have#[test]fn fix_has() {- assert_suggestion_result(- "You has",- PronounVerbAgreement::new(FstDictionary::curated()),- "You have",- );+ assert_suggestion_result("You has", test_linter(), "You have");}#[test]fn fix_have() {- assert_suggestion_result(- "She have",- PronounVerbAgreement::new(FstDictionary::curated()),- "She has",- );+ assert_suggestion_result("She have", test_linter(), "She has");}// hasn't ↔ haven't#[test]fn fix_hasnt() {- assert_suggestion_result(- "You hasn't",- PronounVerbAgreement::new(FstDictionary::curated()),- "You haven't",- );+ assert_suggestion_result("You hasn't", test_linter(), "You haven't");}#[test]fn fix_havent() {- assert_suggestion_result(- "He haven't",- PronounVerbAgreement::new(FstDictionary::curated()),- "He hasn't",- );+ assert_suggestion_result("He haven't", test_linter(), "He hasn't");}// -es#[test]fn fix_box() {- assert_suggestion_result(- "He box",- PronounVerbAgreement::new(FstDictionary::curated()),- "He boxes",- );+ assert_suggestion_result("He box", test_linter(), "He boxes");}#[test]fn fix_boxes() {- assert_suggestion_result(- "You boxes",- PronounVerbAgreement::new(FstDictionary::curated()),- "You box",- );+ assert_suggestion_result("You boxes", test_linter(), "You box");}// TODO: Are there any double consonant endings to change?@@ -535,38 +438,22 @@ mod lints {// doesn't ↔ don't#[test]fn fix_doesnt() {- assert_suggestion_result(- "We doesn't",- PronounVerbAgreement::new(FstDictionary::curated()),- "We don't",- );+ assert_suggestion_result("We doesn't", test_linter(), "We don't");}#[test]// Note: This requires a dedicated branch of the `[Expr]`fn fix_dont() {- assert_suggestion_result(- "It don't",- PronounVerbAgreement::new(FstDictionary::curated()),- "It doesn't",- );+ assert_suggestion_result("It don't", test_linter(), "It doesn't");}// Does do ↔ does behave differently to box ↔ boxes due to being an auxiliary verb?#[test]fn fix_do() {- assert_suggestion_result(- "He do",- PronounVerbAgreement::new(FstDictionary::curated()),- "He does",- );+ assert_suggestion_result("He do", test_linter(), "He does");}#[test]fn fix_does() {- assert_suggestion_result(- "You does",- PronounVerbAgreement::new(FstDictionary::curated()),- "You do",- );+ assert_suggestion_result("You does", test_linter(), "You do");}// False positives found by Elijah@@ -575,7 +462,7 @@ mod lints {fn false_positive_she_consider() {assert_no_lints("On April 10th, I suggested she consider a smaller, more intimate gathering.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -583,7 +470,7 @@ mod lints {fn false_positive_she_sell() {assert_no_lints("I suggested she sell it and use the proceeds to help with her relocation expenses, or perhaps rent a similar camera while in Barcelona.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -591,7 +478,7 @@ mod lints {fn false_positive_she_rent() {assert_no_lints("I suggested she sell it and use the proceeds to help with her relocation expenses, or perhaps rent a similar camera while in Barcelona.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -599,7 +486,7 @@ mod lints {fn false_positive_he_donned() {assert_no_lints("He donned his heavy oilskins and descended the winding staircase, his boots echoing in the hollow tower.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -607,7 +494,7 @@ mod lints {fn false_positive_he_cannot() {assert_no_lints("Surely, he cannot offer the same sum as the developers.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -615,7 +502,7 @@ mod lints {fn false_positive_insisting_she_return() {assert_no_lints("Am I the asshole for insisting she return the dress?",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -623,7 +510,7 @@ mod lints {fn false_positive_pride_in_you_is() {assert_no_lints("It’s also important to recognize that your family's pride in you is a genuine reflection of your value.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -631,7 +518,7 @@ mod lints {fn false_positive_she_sought() {assert_no_lints("She sought out Mrs. Hawthorne, the village’s oldest resident, a woman known for her vast knowledge of local history and her unsettlingly accurate intuition.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -639,7 +526,7 @@ mod lints {fn false_positive_lose_you_points() {assert_no_lints("I admire your dedication to consistently drafting players who are actively trying to lose you points.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -647,7 +534,7 @@ mod lints {fn false_positive_she_hung_up() {assert_no_lints("When I reiterated the conditions I'd previously set, she hung up on me.",- PronounVerbAgreement::new(FstDictionary::curated()),+ test_linter(),);}}diff --git a/harper-core/src/linting/proper_noun_capitalization_linters.rs b/harper-core/src/linting/proper_noun_capitalization_linters.rsindex 49f427ec5..0014107b7 100644--- a/harper-core/src/linting/proper_noun_capitalization_linters.rs+++ b/harper-core/src/linting/proper_noun_capitalization_linters.rs@@ -116,60 +116,68 @@ pub fn lint_group() -> LintGroup {#[cfg(test)]mod tests {use super::lint_group;+ use crate::linting::LintGroup;+ use crate::linting::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_suggestion_result};+ create_test_pool!(LintGroup, LintGroup, lint_group());+#[test]fn americas_lowercase() {- assert_suggestion_result("south america", lint_group(), "South America");- assert_suggestion_result("north america", lint_group(), "North America");+ assert_suggestion_result("south america", test_linter(), "South America");+ assert_suggestion_result("north america", test_linter(), "North America");}#[test]fn americas_uppercase() {- assert_suggestion_result("SOUTH AMERICA", lint_group(), "South America");- assert_suggestion_result("NORTH AMERICA", lint_group(), "North America");+ assert_suggestion_result("SOUTH AMERICA", test_linter(), "South America");+ assert_suggestion_result("NORTH AMERICA", test_linter(), "North America");}#[test]fn americas_allow_correct() {- assert_lint_count("South America", lint_group(), 0);- assert_lint_count("North America", lint_group(), 0);+ assert_lint_count("South America", test_linter(), 0);+ assert_lint_count("North America", test_linter(), 0);}#[test]fn issue_798() {assert_suggestion_result("The United states is a big country.",- lint_group(),+ test_linter(),"The United States is a big country.",);}#[test]fn united_nations_uppercase() {- assert_suggestion_result("UNITED NATIONS", lint_group(), "United Nations");+ assert_suggestion_result("UNITED NATIONS", test_linter(), "United Nations");}#[test]fn united_arab_emirates_lowercase() {- assert_suggestion_result("UNITED ARAB EMIRATES", lint_group(), "United Arab Emirates");+ assert_suggestion_result(+ "UNITED ARAB EMIRATES",+ test_linter(),+ "United Arab Emirates",+ );}#[test]fn united_nations_allow_correct() {- assert_lint_count("United Nations", lint_group(), 0);+ assert_lint_count("United Nations", test_linter(), 0);}#[test]fn meta_allow_correct() {- assert_lint_count("Meta Quest", lint_group(), 0);+ assert_lint_count("Meta Quest", test_linter(), 0);}#[test]fn microsoft_lowercase() {assert_suggestion_result("microsoft visual studio",- lint_group(),+ test_linter(),"Microsoft Visual Studio",);}@@ -178,81 +186,81 @@ mod tests {fn microsoft_first_word_is_correct() {assert_suggestion_result("Microsoft visual studio",- lint_group(),+ test_linter(),"Microsoft Visual Studio",);}#[test]fn test_atlantic_ocean_lowercase() {- assert_suggestion_result("atlantic ocean", lint_group(), "Atlantic Ocean");+ assert_suggestion_result("atlantic ocean", test_linter(), "Atlantic Ocean");}#[test]fn test_pacific_ocean_lowercase() {- assert_suggestion_result("pacific ocean", lint_group(), "Pacific Ocean");+ assert_suggestion_result("pacific ocean", test_linter(), "Pacific Ocean");}#[test]fn test_indian_ocean_lowercase() {- assert_suggestion_result("indian ocean", lint_group(), "Indian Ocean");+ assert_suggestion_result("indian ocean", test_linter(), "Indian Ocean");}#[test]fn test_southern_ocean_lowercase() {- assert_suggestion_result("southern ocean", lint_group(), "Southern Ocean");+ assert_suggestion_result("southern ocean", test_linter(), "Southern Ocean");}#[test]fn test_arctic_ocean_lowercase() {- assert_suggestion_result("arctic ocean", lint_group(), "Arctic Ocean");+ assert_suggestion_result("arctic ocean", test_linter(), "Arctic Ocean");}#[test]fn test_mediterranean_sea_lowercase() {- assert_suggestion_result("mediterranean sea", lint_group(), "Mediterranean Sea");+ assert_suggestion_result("mediterranean sea", test_linter(), "Mediterranean Sea");}#[test]fn test_caribbean_sea_lowercase() {- assert_suggestion_result("caribbean sea", lint_group(), "Caribbean Sea");+ assert_suggestion_result("caribbean sea", test_linter(), "Caribbean Sea");}#[test]fn test_south_china_sea_lowercase() {- assert_suggestion_result("south china sea", lint_group(), "South China Sea");+ assert_suggestion_result("south china sea", test_linter(), "South China Sea");}#[test]fn test_atlantic_ocean_correct() {- assert_lint_count("Atlantic Ocean", lint_group(), 0);+ assert_lint_count("Atlantic Ocean", test_linter(), 0);}#[test]fn test_pacific_ocean_correct() {- assert_lint_count("Pacific Ocean", lint_group(), 0);+ assert_lint_count("Pacific Ocean", test_linter(), 0);}#[test]fn test_indian_ocean_correct() {- assert_lint_count("Indian Ocean", lint_group(), 0);+ assert_lint_count("Indian Ocean", test_linter(), 0);}#[test]fn test_mediterranean_sea_correct() {- assert_lint_count("Mediterranean Sea", lint_group(), 0);+ assert_lint_count("Mediterranean Sea", test_linter(), 0);}#[test]fn test_south_china_sea_correct() {- assert_lint_count("South China Sea", lint_group(), 0);+ assert_lint_count("South China Sea", test_linter(), 0);}#[test]fn day_one_in_sentence() {assert_suggestion_result("I love day one. It is the best journaling app.",- lint_group(),+ test_linter(),"I love Day One. It is the best journaling app.",);}@@ -261,41 +269,41 @@ mod tests {fn gilded_age_in_sentence() {assert_suggestion_result("Mani-Chess Destiny is a JavaScript based computer game built off of chess, but in the style of the gilded age.",- lint_group(),+ test_linter(),"Mani-Chess Destiny is a JavaScript based computer game built off of chess, but in the style of the Gilded Age.",);}#[test]fn chrome_extension_lowercase() {- assert_suggestion_result("chrome extension", lint_group(), "Chrome Extension");+ assert_suggestion_result("chrome extension", test_linter(), "Chrome Extension");}#[test]fn chrome_extension_uppercase() {- assert_suggestion_result("CHROME EXTENSION", lint_group(), "Chrome Extension");+ assert_suggestion_result("CHROME EXTENSION", test_linter(), "Chrome Extension");}#[test]fn chrome_extension_mixed_case() {- assert_suggestion_result("cHrOmE eXtEnSiOn", lint_group(), "Chrome Extension");+ assert_suggestion_result("cHrOmE eXtEnSiOn", test_linter(), "Chrome Extension");}#[test]fn chrome_extension_second_word_lowercase() {- assert_suggestion_result("Chrome extension", lint_group(), "Chrome Extension");+ assert_suggestion_result("Chrome extension", test_linter(), "Chrome Extension");}#[test]fn chrome_extension_first_word_lowercase() {- assert_suggestion_result("chrome Extension", lint_group(), "Chrome Extension");+ assert_suggestion_result("chrome Extension", test_linter(), "Chrome Extension");}#[test]fn chrome_extension_in_sentence() {assert_suggestion_result("Install the chrome extension from the store.",- lint_group(),+ test_linter(),"Install the Chrome Extension from the store.",);}@@ -304,7 +312,7 @@ mod tests {fn chrome_extension_with_leading_article() {assert_suggestion_result("The chrome extension is ready.",- lint_group(),+ test_linter(),"The Chrome Extension is ready.",);}@@ -313,7 +321,7 @@ mod tests {fn chrome_extension_with_trailing_period() {assert_suggestion_result("We shipped the chrome extension.",- lint_group(),+ test_linter(),"We shipped the Chrome Extension.",);}@@ -322,7 +330,7 @@ mod tests {fn chrome_extension_with_trailing_comma() {assert_suggestion_result("The chrome extension, not the app, needs review.",- lint_group(),+ test_linter(),"The Chrome Extension, not the app, needs review.",);}@@ -331,7 +339,7 @@ mod tests {fn chrome_extension_with_trailing_colon() {assert_suggestion_result("Preferred install target: chrome extension",- lint_group(),+ test_linter(),"Preferred install target: Chrome Extension",);}@@ -340,28 +348,28 @@ mod tests {fn chrome_extension_inside_quotes() {assert_suggestion_result("They called it the \"chrome extension\" build.",- lint_group(),+ test_linter(),"They called it the \"Chrome Extension\" build.",);}#[test]fn chrome_extension_across_sentence_boundary_not_present() {- assert_lint_count("Chrome. Extension", lint_group(), 0);+ assert_lint_count("Chrome. Extension", test_linter(), 0);}#[test]fn chrome_extension_allows_correct_case() {- assert_lint_count("Chrome Extension", lint_group(), 0);+ assert_lint_count("Chrome Extension", test_linter(), 0);}#[test]fn chrome_extension_allows_correct_case_in_sentence() {- assert_lint_count("The Chrome Extension is ready.", lint_group(), 0);+ assert_lint_count("The Chrome Extension is ready.", test_linter(), 0);}#[test]fn browser_extension_not_flagged() {- assert_lint_count("browser extension", lint_group(), 0);+ assert_lint_count("browser extension", test_linter(), 0);}}diff --git a/harper-core/src/linting/quite_quiet.rs b/harper-core/src/linting/quite_quiet.rsindex 5ae33ff31..7bb270ec8 100644--- a/harper-core/src/linting/quite_quiet.rs+++ b/harper-core/src/linting/quite_quiet.rs@@ -123,6 +123,9 @@ impl ExprLinter for QuiteQuiet {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(QuiteQuiet, QuiteQuiet, QuiteQuiet::default());use super::QuiteQuiet;use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};@@ -130,7 +133,7 @@ mod tests {fn fix_quiet_adverb() {assert_suggestion_result("Rendering videos 145 frames, with lightx loras for 2.1 i experience reboots quiet often.",- QuiteQuiet::default(),+ test_linter(),"Rendering videos 145 frames, with lightx loras for 2.1 i experience reboots quite often.",);}@@ -139,7 +142,7 @@ mod tests {fn fix_quiet_adjective() {assert_suggestion_result("... has been already reported multiple times and I find it quiet dumb that it still exists",- QuiteQuiet::default(),+ test_linter(),"... has been already reported multiple times and I find it quite dumb that it still exists",);}@@ -148,40 +151,40 @@ mod tests {fn fix_very_quite() {assert_suggestion_result("It's very quite here at night.",- QuiteQuiet::default(),+ test_linter(),"It's very quiet here at night.",);}#[test]fn fix_doesnt_quiet() {- assert_suggestion_result("doesn't quiet", QuiteQuiet::default(), "doesn't quite");+ assert_suggestion_result("doesn't quiet", test_linter(), "doesn't quite");}#[test]fn fix_doesnt_quiet_typographical_apostrophe() {- assert_suggestion_result("doesn’t quiet", QuiteQuiet::default(), "doesn’t quite");+ assert_suggestion_result("doesn’t quiet", test_linter(), "doesn’t quite");}#[test]fn fix_doesnt_quiet_in_context() {assert_suggestion_result("When we got the car back into the workshop, we actually managed to get it running and driving, but it doesn't quiet run right, and doesn't really let me rev it.",- QuiteQuiet::default(),+ test_linter(),"When we got the car back into the workshop, we actually managed to get it running and driving, but it doesn't quite run right, and doesn't really let me rev it.",);}#[test]fn dont_flag_quiet_light() {- assert_lint_count("The quiet lights in the houses", QuiteQuiet::default(), 0);+ assert_lint_count("The quiet lights in the houses", test_linter(), 0);}#[test]fn dont_flag_quiet_till() {assert_lint_count("You’d better try and sit quiet till morning.",- QuiteQuiet::default(),+ test_linter(),0,);}@@ -190,141 +193,122 @@ mod tests {fn fix_cant_quiet() {assert_suggestion_result("I can't quiet read it",- QuiteQuiet::default(),+ test_linter(),"I can't quite read it",);}#[test]fn fix_wont_quiet() {- assert_suggestion_result(- "It won't quiet fit",- QuiteQuiet::default(),- "It won't quite fit",- );+ assert_suggestion_result("It won't quiet fit", test_linter(), "It won't quite fit");}#[test]fn fix_couldnt_quiet() {assert_suggestion_result("I couldn't quiet understand everything",- QuiteQuiet::default(),+ test_linter(),"I couldn't quite understand everything",);}#[test]fn fix_but_its_not_quite_clear_1956() {- assert_no_lints("But it's not quite clear", QuiteQuiet::default());+ assert_no_lints("But it's not quite clear", test_linter());}#[test]fn dont_flag_adv_quite_1971() {assert_no_lints("It’s actually quite smart. It’s really quite smart. The proof is actually quite neat. Actually really quite simple. It’s actually quite strong. The Sneetches got really quite smart on that day.",- QuiteQuiet::default(),+ test_linter(),);}#[test]fn issue_2003() {- assert_no_lints(- "The namespaces are generally quite short",- QuiteQuiet::default(),- );+ assert_no_lints("The namespaces are generally quite short", test_linter());}// --- Predicate adjective: change-of-state verbs + prepositions ---#[test]fn dont_flag_go_quiet_for() {- assert_no_lints(- "If I go quiet for a week… yeah I'm dead.",- QuiteQuiet::default(),- );+ assert_no_lints("If I go quiet for a week… yeah I'm dead.", test_linter());}#[test]fn dont_flag_went_quiet_about() {- assert_no_lints(- "He went quiet about the whole thing.",- QuiteQuiet::default(),- );+ assert_no_lints("He went quiet about the whole thing.", test_linter());}#[test]fn dont_flag_keep_quiet_about() {- assert_no_lints("She kept quiet about what happened.", QuiteQuiet::default());+ assert_no_lints("She kept quiet about what happened.", test_linter());}#[test]fn dont_flag_stay_quiet_during() {- assert_no_lints(- "Please stay quiet during the presentation.",- QuiteQuiet::default(),- );+ assert_no_lints("Please stay quiet during the presentation.", test_linter());}#[test]fn dont_flag_fell_quiet_after() {- assert_no_lints(- "The room fell quiet after the announcement.",- QuiteQuiet::default(),- );+ assert_no_lints("The room fell quiet after the announcement.", test_linter());}#[test]fn dont_flag_remained_quiet_in() {- assert_no_lints("She remained quiet in meetings.", QuiteQuiet::default());+ assert_no_lints("She remained quiet in meetings.", test_linter());}#[test]fn dont_flag_grew_quiet_on() {- assert_no_lints("He grew quiet on the matter.", QuiteQuiet::default());+ assert_no_lints("He grew quiet on the matter.", test_linter());}#[test]fn dont_flag_be_quiet_for() {- assert_no_lints("Be quiet for a moment.", QuiteQuiet::default());+ assert_no_lints("Be quiet for a moment.", test_linter());}// --- Predicate adjective: conjunctions ---#[test]fn dont_flag_quiet_and() {- assert_no_lints("Stay quiet and listen.", QuiteQuiet::default());+ assert_no_lints("Stay quiet and listen.", test_linter());}#[test]fn dont_flag_quiet_but() {- assert_no_lints("She was quiet but firm.", QuiteQuiet::default());+ assert_no_lints("She was quiet but firm.", test_linter());}// --- Predicate adjective: temporal/locative adverbs ---#[test]fn dont_flag_quiet_now() {- assert_no_lints("Be quiet now.", QuiteQuiet::default());+ assert_no_lints("Be quiet now.", test_linter());}#[test]fn dont_flag_quiet_there() {- assert_no_lints("It's quiet there.", QuiteQuiet::default());+ assert_no_lints("It's quiet there.", test_linter());}#[test]fn dont_flag_quiet_down() {- assert_no_lints("Quiet down, everyone.", QuiteQuiet::default());+ assert_no_lints("Quiet down, everyone.", test_linter());}#[test]fn dont_flag_quiet_enough() {- assert_no_lints("The room was quiet enough.", QuiteQuiet::default());+ assert_no_lints("The room was quiet enough.", test_linter());}#[test]fn dont_flag_quiet_lately() {- assert_no_lints("It's been quiet lately.", QuiteQuiet::default());+ assert_no_lints("It's been quiet lately.", test_linter());}// --- Still catches genuine typos ---@@ -333,7 +317,7 @@ mod tests {fn still_catches_quiet_remarkable() {assert_suggestion_result("That was quiet remarkable.",- QuiteQuiet::default(),+ test_linter(),"That was quite remarkable.",);}@@ -342,7 +326,7 @@ mod tests {fn still_catches_quiet_impressive() {assert_suggestion_result("That was quiet impressive.",- QuiteQuiet::default(),+ test_linter(),"That was quite impressive.",);}@@ -351,24 +335,21 @@ mod tests {#[test]fn dont_flag_probably_quite_doable_3560() {- assert_no_lints("It's probably quite doable.", QuiteQuiet::default());+ assert_no_lints("It's probably quite doable.", test_linter());}#[test]fn dont_flag_probably_quite_reasonable_3560() {- assert_no_lints(- "That seems probably quite reasonable.",- QuiteQuiet::default(),- );+ assert_no_lints("That seems probably quite reasonable.", test_linter());}#[test]fn dont_flag_quite_happy_3560() {- assert_no_lints("I'm quite happy with the result.", QuiteQuiet::default());+ assert_no_lints("I'm quite happy with the result.", test_linter());}#[test]fn dont_flag_quite_large_3560() {- assert_no_lints("The project is quite large.", QuiteQuiet::default());+ assert_no_lints("The project is quite large.", test_linter());}}diff --git a/harper-core/src/linting/redundant_self.rs b/harper-core/src/linting/redundant_self.rsindex 544e8f3ed..3125ee574 100644--- a/harper-core/src/linting/redundant_self.rs+++ b/harper-core/src/linting/redundant_self.rs@@ -162,19 +162,22 @@ impl ExprLinter for RedundantSelf {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_good_and_bad_suggestions, assert_no_lints, assert_suggestion_result,};use super::RedundantSelf;+ create_test_pool!(RedundantSelf, RedundantSelf, RedundantSelf::default());+// Self-harm onself test#[test]fn fix_self_harm_herself_hy() {assert_good_and_bad_suggestions("Camille about to self-harm herself",- RedundantSelf::default(),+ test_linter(),&["Camille about to harm herself","Camille about to self-harm",@@ -187,7 +190,7 @@ mod tests {fn fix_self_harming_herself_hy() {assert_good_and_bad_suggestions("At times she was suicidal and started self-harming herself when she was 12.",- RedundantSelf::default(),+ test_linter(),&["At times she was suicidal and started harming herself when she was 12.","At times she was suicidal and started self-harming when she was 12.",@@ -200,7 +203,7 @@ mod tests {fn fix_self_harming_herself_sp() {assert_good_and_bad_suggestions("Violet self harming herself is inter-spliced in this montage and Tate walks in to tell her she's cutting the wrong way.",- RedundantSelf::default(),+ test_linter(),&["Violet harming herself is inter-spliced in this montage and Tate walks in to tell her she's cutting the wrong way.","Violet self harming is inter-spliced in this montage and Tate walks in to tell her she's cutting the wrong way.",@@ -213,7 +216,7 @@ mod tests {fn fix_self_harming_himself_hy() {assert_good_and_bad_suggestions("I don't know the reason till now for doing so but I'm sure he was self-harming himself.",- RedundantSelf::default(),+ test_linter(),&["I don't know the reason till now for doing so but I'm sure he was harming himself.","I don't know the reason till now for doing so but I'm sure he was self-harming.",@@ -226,7 +229,7 @@ mod tests {fn fix_self_harming_myself_sp() {assert_good_and_bad_suggestions("I'm no programmer or anything like that but I like staying up late at night and self harming myself trying to get ajax to work.",- RedundantSelf::default(),+ test_linter(),&["I'm no programmer or anything like that but I like staying up late at night and harming myself trying to get ajax to work.","I'm no programmer or anything like that but I like staying up late at night and self harming trying to get ajax to work.",@@ -239,7 +242,7 @@ mod tests {fn fix_self_harming_myself_hy() {assert_good_and_bad_suggestions("How I stopped self-harming myself",- RedundantSelf::default(),+ test_linter(),&["How I stopped harming myself", "How I stopped self-harming"],&[],);@@ -249,7 +252,7 @@ mod tests {fn fix_self_harm_to_myself_hy() {assert_good_and_bad_suggestions("I'm glad that I didn't do any self-harm to myself",- RedundantSelf::default(),+ test_linter(),&["I'm glad that I didn't do any harm to myself","I'm glad that I didn't do any self-harm",@@ -262,7 +265,7 @@ mod tests {fn fix_self_harm_to_myself_sp() {assert_good_and_bad_suggestions("so I did self harm to myself with the teacher noticing",- RedundantSelf::default(),+ test_linter(),&["so I did harm to myself with the teacher noticing","so I did self harm with the teacher noticing",@@ -275,7 +278,7 @@ mod tests {fn fix_self_harmed_myself_sp() {assert_good_and_bad_suggestions("I haven't self harmed myself in exactly 3 months and 4 days!!!",- RedundantSelf::default(),+ test_linter(),&["I haven't harmed myself in exactly 3 months and 4 days!!!","I haven't self harmed in exactly 3 months and 4 days!!!",@@ -288,7 +291,7 @@ mod tests {fn fix_self_harmed_themself_sp() {assert_good_and_bad_suggestions("trusted you enough to tell you that they self harmed themself",- RedundantSelf::default(),+ test_linter(),&["trusted you enough to tell you that they harmed themself","trusted you enough to tell you that they self harmed",@@ -301,7 +304,7 @@ mod tests {fn fix_self_harming_yourself_hy() {assert_good_and_bad_suggestions("Is psychologically self-harming yourself on purpose possible",- RedundantSelf::default(),+ test_linter(),&["Is psychologically harming yourself on purpose possible","Is psychologically self-harming on purpose possible",@@ -314,7 +317,7 @@ mod tests {fn fix_self_harming_yourself_sp() {assert_good_and_bad_suggestions("What isn't seen as self harming yourself but actually is?",- RedundantSelf::default(),+ test_linter(),&["What isn't seen as harming yourself but actually is?","What isn't seen as self harming but actually is?",@@ -327,7 +330,7 @@ mod tests {fn fix_self_harm_to_yourself_hy() {assert_good_and_bad_suggestions("First of all, do not turn to physical abuse or any type of self-harm to yourself.",- RedundantSelf::default(),+ test_linter(),&["First of all, do not turn to physical abuse or any type of harm to yourself.","First of all, do not turn to physical abuse or any type of self-harm.",@@ -342,7 +345,7 @@ mod tests {fn fix_self_teaching_myself() {assert_suggestion_result("This is a reference of me self-teaching myself the Barvinok algorithm.",- RedundantSelf::default(),+ test_linter(),"This is a reference of me teaching myself the Barvinok algorithm.",);}@@ -351,7 +354,7 @@ mod tests {fn fix_self_taught_myself() {assert_suggestion_result("Since I wasn't blessed to learn security related topic back when I was undergrad, I self taught myself using udemy, and CTF Challenge online.",- RedundantSelf::default(),+ test_linter(),"Since I wasn't blessed to learn security related topic back when I was undergrad, I taught myself using udemy, and CTF Challenge online.",);}@@ -360,7 +363,7 @@ mod tests {fn fix_self_teach_myself() {assert_suggestion_result("I decided to self-teach myself python so I could get more involved in wider aspects of research, specifically data science.",- RedundantSelf::default(),+ test_linter(),"I decided to teach myself python so I could get more involved in wider aspects of research, specifically data science.",);}@@ -370,7 +373,7 @@ mod tests {fn fix_self_teaching_themselves() {assert_suggestion_result("The point of OSSU is to make things easier for people self-teaching themselves CS.",- RedundantSelf::default(),+ test_linter(),"The point of OSSU is to make things easier for people teaching themselves CS.",);}@@ -381,7 +384,7 @@ mod tests {fn fix_self_host_it_yourself() {assert_good_and_bad_suggestions("If you want to self-host it yourself, get the latest release and download the distributable zip file attached to it",- RedundantSelf::default(),+ test_linter(),&["If you want to self-host it, get the latest release and download the distributable zip file attached to it","If you want to host it yourself, get the latest release and download the distributable zip file attached to it",@@ -394,7 +397,7 @@ mod tests {fn fix_self_hosting_it_themselves() {assert_good_and_bad_suggestions("I've open-sourced the codebase and written an installation guide to make it as easy as possible for others who are interested in self-hosting it themselves.",- RedundantSelf::default(),+ test_linter(),&["I've open-sourced the codebase and written an installation guide to make it as easy as possible for others who are interested in self-hosting it.","I've open-sourced the codebase and written an installation guide to make it as easy as possible for others who are interested in hosting it themselves.",@@ -407,7 +410,7 @@ mod tests {fn fix_self_hosted_one_myself() {assert_good_and_bad_suggestions("I though WalletConnect bridge server might be too flooded with requests, so I self-hosted one myself, same result.",- RedundantSelf::default(),+ test_linter(),&["I though WalletConnect bridge server might be too flooded with requests, so I self-hosted one, same result.","I though WalletConnect bridge server might be too flooded with requests, so I hosted one myself, same result.",@@ -422,7 +425,7 @@ mod tests {fn fix_self_diagnosed_myself() {assert_good_and_bad_suggestions("As a professional amateur doctor I have self-diagnosed myself with a mild case of alzheimer",- RedundantSelf::default(),+ test_linter(),&["As a professional amateur doctor I have self-diagnosed with a mild case of alzheimer","As a professional amateur doctor I have diagnosed myself with a mild case of alzheimer",@@ -435,7 +438,7 @@ mod tests {fn fix_self_diagnose_himself() {assert_good_and_bad_suggestions("a user can add his X-ray image in the application and he will be able to self diagnose himself",- RedundantSelf::default(),+ test_linter(),&["a user can add his X-ray image in the application and he will be able to self diagnose","a user can add his X-ray image in the application and he will be able to diagnose himself",@@ -448,7 +451,7 @@ mod tests {fn fix_self_diagnose_itself() {assert_good_and_bad_suggestions("a spare should self-diagnose itself and generate then store its performance stats in performance.txt",- RedundantSelf::default(),+ test_linter(),&["a spare should self-diagnose and generate then store its performance stats in performance.txt","a spare should diagnose itself and generate then store its performance stats in performance.txt",@@ -461,7 +464,7 @@ mod tests {fn fix_self_diagnose_themselves() {assert_good_and_bad_suggestions("Team application designed as a mediatery to help users self diagnose themselves or seek medical attention",- RedundantSelf::default(),+ test_linter(),&["Team application designed as a mediatery to help users self diagnose or seek medical attention","Team application designed as a mediatery to help users diagnose themselves or seek medical attention",@@ -476,7 +479,7 @@ mod tests {fn fix_self_describe_myself() {assert_good_and_bad_suggestions("Moreover, each thing itself can self-describe itself under well-known, e.g.",- RedundantSelf::default(),+ test_linter(),&["Moreover, each thing itself can self-describe under well-known, e.g.","Moreover, each thing itself can describe itself under well-known, e.g.",@@ -489,7 +492,7 @@ mod tests {fn fix_self_described_yourself() {assert_good_and_bad_suggestions("I know this is asking for a lot, but since you self-described yourself as a documentation nerd- would you be willing to help ...",- RedundantSelf::default(),+ test_linter(),&["I know this is asking for a lot, but since you self-described as a documentation nerd- would you be willing to help ...","I know this is asking for a lot, but since you described yourself as a documentation nerd- would you be willing to help ...",@@ -502,7 +505,7 @@ mod tests {fn fix_self_describes_itself() {assert_good_and_bad_suggestions("httpx self-describes itself as HTTPX is a fully featured HTTP client for Python 3",- RedundantSelf::default(),+ test_linter(),&["httpx self-describes as HTTPX is a fully featured HTTP client for Python 3","httpx describes itself as HTTPX is a fully featured HTTP client for Python 3",@@ -515,7 +518,7 @@ mod tests {fn fix_self_describe_themselves() {assert_good_and_bad_suggestions("This, along with some other capabilities, will better allow route handler delegates to self-describe themselves from just the type",- RedundantSelf::default(),+ test_linter(),&["This, along with some other capabilities, will better allow route handler delegates to self-describe from just the type","This, along with some other capabilities, will better allow route handler delegates to describe themselves from just the type",@@ -530,7 +533,7 @@ mod tests {fn fix_self_medicate_ourselves() {assert_good_and_bad_suggestions("Needless to say we took advantage of this to self-medicate ourselves during the scheduled downtime.",- RedundantSelf::default(),+ test_linter(),&["Needless to say we took advantage of this to self-medicate during the scheduled downtime.","Needless to say we took advantage of this to medicate ourselves during the scheduled downtime.",@@ -543,7 +546,7 @@ mod tests {fn fix_self_medicate_themselves() {assert_good_and_bad_suggestions("the patient decides to self-medicate themselves, thereby subjecting themselves to additional harms",- RedundantSelf::default(),+ test_linter(),&["the patient decides to self-medicate, thereby subjecting themselves to additional harms","the patient decides to medicate themselves, thereby subjecting themselves to additional harms",@@ -558,7 +561,7 @@ mod tests {fn fix_self_sabotaging_yourself() {assert_good_and_bad_suggestions("How to stop self-sabotaging yourself. (My struggle with self-sabotagers) has already been recorded in the archive",- RedundantSelf::default(),+ test_linter(),&["How to stop self-sabotaging. (My struggle with self-sabotagers) has already been recorded in the archive","How to stop sabotaging yourself. (My struggle with self-sabotagers) has already been recorded in the archive",@@ -571,7 +574,7 @@ mod tests {fn fix_self_sabotage_themselves() {assert_good_and_bad_suggestions("I also just don't get why as an artist you'd self sabotage yourself, but you do you if you want you work to be replaced by lazy bastards",- RedundantSelf::default(),+ test_linter(),&["I also just don't get why as an artist you'd self sabotage, but you do you if you want you work to be replaced by lazy bastards","I also just don't get why as an artist you'd sabotage yourself, but you do you if you want you work to be replaced by lazy bastards",@@ -586,7 +589,7 @@ mod tests {fn fix_self_correct_itself() {assert_good_and_bad_suggestions("Going against the gradient assure that the algorithm self-correct itself, i.e. we obtain parameters that lead to predictions closer and closer to the actual ...",- RedundantSelf::default(),+ test_linter(),&["Going against the gradient assure that the algorithm correct itself, i.e. we obtain parameters that lead to predictions closer and closer to the actual ...","Going against the gradient assure that the algorithm self-correct, i.e. we obtain parameters that lead to predictions closer and closer to the actual ...",@@ -599,7 +602,7 @@ mod tests {fn fix_self_corrects_itself() {assert_good_and_bad_suggestions("Self corrects itself by fetching the width of the parent",- RedundantSelf::default(),+ test_linter(),&["Self corrects by fetching the width of the parent","Corrects itself by fetching the width of the parent",@@ -612,7 +615,7 @@ mod tests {fn fix_self_correcting_itself() {assert_good_and_bad_suggestions("the server handling the http site being out of date and then self-correcting itself",- RedundantSelf::default(),+ test_linter(),&["the server handling the http site being out of date and then correcting itself","the server handling the http site being out of date and then self-correcting",@@ -627,7 +630,7 @@ mod tests {fn fix_self_regulate_myself() {assert_good_and_bad_suggestions("Fun fact: Self Regulate myself with Meditation",- RedundantSelf::default(),+ test_linter(),&[// TODO: due to a quirk in `replace_with_match_case`, this generates `ReguLate`// "Fun fact: Regulate myself with Meditation",@@ -641,7 +644,7 @@ mod tests {fn fix_self_regulating_ourselves() {assert_good_and_bad_suggestions("in general we should be self regulating ourselves and trying to help each other succeed",- RedundantSelf::default(),+ test_linter(),&["in general we should be regulating ourselves and trying to help each other succeed","in general we should be self regulating and trying to help each other succeed",@@ -656,7 +659,7 @@ mod tests {fn fix_self_censor_themselves() {assert_good_and_bad_suggestions("this would not be desirable, as capturees would be able to self-censor themselves when captured",- RedundantSelf::default(),+ test_linter(),&["this would not be desirable, as capturees would be able to censor themselves when captured","this would not be desirable, as capturees would be able to self-censor when captured",@@ -669,7 +672,7 @@ mod tests {fn fix_self_censoring_themselves() {assert_good_and_bad_suggestions("Although people often realize that they are self-censoring themselves, it is not always the case.",- RedundantSelf::default(),+ test_linter(),&["Although people often realize that they are censoring themselves, it is not always the case.","Although people often realize that they are self-censoring, it is not always the case.",@@ -684,7 +687,7 @@ mod tests {fn fix_self_govern_themselves() {assert_good_and_bad_suggestions("system that enables Founders and investors to coordinate and self-govern themselves through a set of self-executing rules published on a public blockchain",- RedundantSelf::default(),+ test_linter(),&["system that enables Founders and investors to coordinate and govern themselves through a set of self-executing rules published on a public blockchain","system that enables Founders and investors to coordinate and self-govern through a set of self-executing rules published on a public blockchain",@@ -699,7 +702,7 @@ mod tests {fn fix_self_identify_itself() {assert_good_and_bad_suggestions("We need this in order for a job to be able to self-identify itself and potentially send it's own ID to a different service",- RedundantSelf::default(),+ test_linter(),&["We need this in order for a job to be able to identify itself and potentially send it's own ID to a different service","We need this in order for a job to be able to self-identify and potentially send it's own ID to a different service",@@ -712,7 +715,7 @@ mod tests {fn fix_self_identified_themselves() {assert_good_and_bad_suggestions("This is how the workers self-identified themselves to the scheduler.",- RedundantSelf::default(),+ test_linter(),&["This is how the workers identified themselves to the scheduler.","This is how the workers self-identified to the scheduler.",@@ -727,31 +730,25 @@ mod tests {fn dont_flag_self_harm_itself() {assert_no_lints("I understand that self harm itself isn't something that you would have to report.",- RedundantSelf::default(),+ test_linter(),);}#[test]fn dont_flag_self_host_without_pronoun() {- assert_no_lints(- "I prefer to self-host my applications",- RedundantSelf::default(),- );+ assert_no_lints("I prefer to self-host my applications", test_linter());}#[test]fn dont_flag_host_without_self() {- assert_no_lints(- "They decided to host it themselves",- RedundantSelf::default(),- );+ assert_no_lints("They decided to host it themselves", test_linter());}#[test]fn fix_self_right_itself() {assert_good_and_bad_suggestions("Witch Doctor was able to self-right itself but End Game delivered another massive hit that sent Witch Doctor several feet in the air.",- RedundantSelf::default(),+ test_linter(),&["Witch Doctor was able to right itself but End Game delivered another massive hit that sent Witch Doctor several feet in the air.","Witch Doctor was able to self-right but End Game delivered another massive hit that sent Witch Doctor several feet in the air.",@@ -764,7 +761,7 @@ mod tests {fn fix_self_rights_itself() {assert_good_and_bad_suggestions("Bite Force self-rights itself.",- RedundantSelf::default(),+ test_linter(),&["Bite Force rights itself.", "Bite Force self-rights."],&[],);@@ -774,7 +771,7 @@ mod tests {fn fix_self_righted_itself() {assert_good_and_bad_suggestions("End Game took Witch Doctor for a ride into the screws but Witch Doctor once again self-righted itself.",- RedundantSelf::default(),+ test_linter(),&["End Game took Witch Doctor for a ride into the screws but Witch Doctor once again righted itself.","End Game took Witch Doctor for a ride into the screws but Witch Doctor once again self-righted.",@@ -787,7 +784,7 @@ mod tests {fn fix_self_defend_itself() {assert_suggestion_result("I'm on dudes side, the person that self defended himself",- RedundantSelf::default(),+ test_linter(),"I'm on dudes side, the person that defended himself",);}diff --git a/harper-core/src/linting/simple_past_to_past_participle.rs b/harper-core/src/linting/simple_past_to_past_participle.rsindex 639ec45fa..331a01d62 100644--- a/harper-core/src/linting/simple_past_to_past_participle.rs+++ b/harper-core/src/linting/simple_past_to_past_participle.rs@@ -104,6 +104,13 @@ impl ExprLinter for SimplePastToPastParticiple {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(+ SimplePastToPastParticiple,+ SimplePastToPastParticiple,+ SimplePastToPastParticiple::default()+ );use super::SimplePastToPastParticiple;use crate::linting::tests::{assert_no_lints, assert_suggestion_result};@@ -113,7 +120,7 @@ mod tests {fn correct_have_went() {assert_suggestion_result("I have went into the btle.py file and added a print statement in _connect()",- SimplePastToPastParticiple::default(),+ test_linter(),"I have gone into the btle.py file and added a print statement in _connect()",);}@@ -122,7 +129,7 @@ mod tests {fn correct_had_went() {assert_suggestion_result("Not sure if TroLoos had went from Tasmota->minimal->Tasmota, or directly Minimal->Tasmota, but going ESPHome->Minimal->Tasmota is not possible",- SimplePastToPastParticiple::default(),+ test_linter(),"Not sure if TroLoos had gone from Tasmota->minimal->Tasmota, or directly Minimal->Tasmota, but going ESPHome->Minimal->Tasmota is not possible",);}@@ -131,7 +138,7 @@ mod tests {fn correct_having_went() {assert_suggestion_result("Having went through the setup guidelines and picking react starter, running npm run watch results in an error",- SimplePastToPastParticiple::default(),+ test_linter(),"Having gone through the setup guidelines and picking react starter, running npm run watch results in an error",);}@@ -140,7 +147,7 @@ mod tests {fn correct_has_went() {assert_suggestion_result("I would like to report that the package request which you are loading has went into maintenance mode.",- SimplePastToPastParticiple::default(),+ test_linter(),"I would like to report that the package request which you are loading has gone into maintenance mode.",);}@@ -149,7 +156,7 @@ mod tests {fn correct_have_wrote() {assert_suggestion_result("and while people have wrote partial ImGuiStyle save and ...",- SimplePastToPastParticiple::default(),+ test_linter(),"and while people have written partial ImGuiStyle save and ...",);}@@ -158,7 +165,7 @@ mod tests {fn correct_has_came() {assert_suggestion_result("and mail has came to a work account",- SimplePastToPastParticiple::default(),+ test_linter(),"and mail has come to a work account",);}@@ -167,7 +174,7 @@ mod tests {fn correct_have_took() {assert_suggestion_result("The Keychain took longer than I'd like it to have took, but it still works",- SimplePastToPastParticiple::default(),+ test_linter(),"The Keychain took longer than I'd like it to have taken, but it still works",);}@@ -176,7 +183,7 @@ mod tests {fn correct_have_did() {assert_suggestion_result("so I have did like below: cd ~/.pub-cache/hosted/pub.dev/",- SimplePastToPastParticiple::default(),+ test_linter(),"so I have done like below: cd ~/.pub-cache/hosted/pub.dev/",);}@@ -185,7 +192,7 @@ mod tests {fn correct_has_fell() {assert_suggestion_result("ScopedHistory instance has fell out of scope ...",- SimplePastToPastParticiple::default(),+ test_linter(),"ScopedHistory instance has fallen out of scope ...",);}@@ -194,7 +201,7 @@ mod tests {fn correct_have_broke() {assert_suggestion_result("PlanningEnitity to see the hard constraints that it may have broke",- SimplePastToPastParticiple::default(),+ test_linter(),"PlanningEnitity to see the hard constraints that it may have broken",);}@@ -203,7 +210,7 @@ mod tests {fn correct_had_began() {assert_suggestion_result("I had began learning Android App development since Aug 2021",- SimplePastToPastParticiple::default(),+ test_linter(),"I had begun learning Android App development since Aug 2021",);}@@ -212,7 +219,7 @@ mod tests {fn correct_have_gave() {assert_suggestion_result("I'm not aware we have gave up SM75, why are you asking this?",- SimplePastToPastParticiple::default(),+ test_linter(),"I'm not aware we have given up SM75, why are you asking this?",);}@@ -221,7 +228,7 @@ mod tests {fn correct_have_saw() {assert_suggestion_result("I have saw that your paper has been accepted by JAIR",- SimplePastToPastParticiple::default(),+ test_linter(),"I have seen that your paper has been accepted by JAIR",);}@@ -230,7 +237,7 @@ mod tests {fn correct_have_spoke() {assert_suggestion_result("so i may have spoke in error",- SimplePastToPastParticiple::default(),+ test_linter(),"so i may have spoken in error",);}@@ -239,7 +246,7 @@ mod tests {fn correct_has_became() {assert_suggestion_result("but it has became failed after v2.6.1",- SimplePastToPastParticiple::default(),+ test_linter(),"but it has become failed after v2.6.1",);}@@ -248,7 +255,7 @@ mod tests {fn correct_have_knew() {assert_suggestion_result("Oh, I have knew this. You can decrypted it in \"Assetstudio\".",- SimplePastToPastParticiple::default(),+ test_linter(),"Oh, I have known this. You can decrypted it in \"Assetstudio\".",);}@@ -257,7 +264,7 @@ mod tests {fn correct_have_drank() {assert_suggestion_result("User should be able to see approximately how much water they have drank today",- SimplePastToPastParticiple::default(),+ test_linter(),"User should be able to see approximately how much water they have drunk today",);}@@ -267,7 +274,7 @@ mod tests {fn being_woke() {assert_suggestion_result("and the containers will not being woke up until I execute a \"docker ps\"",- SimplePastToPastParticiple::default(),+ test_linter(),"and the containers will not being woken up until I execute a \"docker ps\"",);}@@ -276,7 +283,7 @@ mod tests {fn correct_has_flew() {assert_suggestion_result("Well time has flew and I was quite busy but I remember this conversation so I am sharing this with you.",- SimplePastToPastParticiple::default(),+ test_linter(),"Well time has flown and I was quite busy but I remember this conversation so I am sharing this with you.",);}@@ -285,7 +292,7 @@ mod tests {fn correct_being_stole() {assert_suggestion_result("any requests to obtain the hostname will return the hostname of the container being stole",- SimplePastToPastParticiple::default(),+ test_linter(),"any requests to obtain the hostname will return the hostname of the container being stolen",);}@@ -294,7 +301,7 @@ mod tests {fn correct_are_broke() {assert_suggestion_result("They all worked wonderfully under 3.4.2 and all are broke under 3.5.1.",- SimplePastToPastParticiple::default(),+ test_linter(),"They all worked wonderfully under 3.4.2 and all are broken under 3.5.1.",);}@@ -303,7 +310,7 @@ mod tests {fn correct_were_gave() {assert_suggestion_result("Some devices were gave up during a storm recently, but some are still the same as before.",- SimplePastToPastParticiple::default(),+ test_linter(),"Some devices were given up during a storm recently, but some are still the same as before.",);}@@ -312,7 +319,7 @@ mod tests {fn correct_be_saw() {assert_suggestion_result("Currently, it's 14560/14550 for default mavlink RX/TX, which can be saw in wfb-cli .",- SimplePastToPastParticiple::default(),+ test_linter(),"Currently, it's 14560/14550 for default mavlink RX/TX, which can be seen in wfb-cli .",);}@@ -321,7 +328,7 @@ mod tests {fn correct_was_began() {assert_suggestion_result("The initial intent, when v1alpha3 was began, was that almost all usages of InitConfiguration outside of kubeadm init code, could be easily replaced",- SimplePastToPastParticiple::default(),+ test_linter(),"The initial intent, when v1alpha3 was begun, was that almost all usages of InitConfiguration outside of kubeadm init code, could be easily replaced",);}@@ -330,7 +337,7 @@ mod tests {fn correct_was_gave() {assert_suggestion_result("you will find the config file path was gave by -c argument",- SimplePastToPastParticiple::default(),+ test_linter(),"you will find the config file path was given by -c argument",);}@@ -339,7 +346,7 @@ mod tests {fn correct_be_began() {assert_suggestion_result("Ticket requires something from design before it can be began.",- SimplePastToPastParticiple::default(),+ test_linter(),"Ticket requires something from design before it can be begun.",);}@@ -348,7 +355,7 @@ mod tests {fn correct_being_took() {assert_suggestion_result("Dunno, I saw some old threads about port not being took into account in asw-sdk library but seems fixed on aws side.",- SimplePastToPastParticiple::default(),+ test_linter(),"Dunno, I saw some old threads about port not being taken into account in asw-sdk library but seems fixed on aws side.",);}@@ -357,7 +364,7 @@ mod tests {fn correct_are_took() {assert_suggestion_result("In the example provided, TP53 and LMNB1 genes are took as seeds.",- SimplePastToPastParticiple::default(),+ test_linter(),"In the example provided, TP53 and LMNB1 genes are taken as seeds.",);}@@ -368,7 +375,7 @@ mod tests {fn correct_ive_went() {assert_suggestion_result("I've went through some tutorials and went back and forth with AI translating programs from one language to the other.",- SimplePastToPastParticiple::default(),+ test_linter(),"I've gone through some tutorials and went back and forth with AI translating programs from one language to the other.",);}@@ -377,7 +384,7 @@ mod tests {fn correct_ive_went_no_apostrophe() {assert_suggestion_result("I've went thru all the steps to help fix this Virus issue and im locked up.",- SimplePastToPastParticiple::default(),+ test_linter(),"I've gone thru all the steps to help fix this Virus issue and im locked up.",);}@@ -386,7 +393,7 @@ mod tests {fn correct_id_did() {assert_suggestion_result("I'd did a calibration after the FW update now.",- SimplePastToPastParticiple::default(),+ test_linter(),"I'd done a calibration after the FW update now.",);}@@ -395,7 +402,7 @@ mod tests {fn correct_weve_went() {assert_suggestion_result("Thanks for the feedback, but the issue is no longer relevant since we've went with different approach.",- SimplePastToPastParticiple::default(),+ test_linter(),"Thanks for the feedback, but the issue is no longer relevant since we've gone with different approach.",);}@@ -404,7 +411,7 @@ mod tests {fn correct_wed_chose() {assert_suggestion_result("whatever number we'd chose, only one tab will be allowed to run",- SimplePastToPastParticiple::default(),+ test_linter(),"whatever number we'd chosen, only one tab will be allowed to run",);}@@ -413,7 +420,7 @@ mod tests {fn correct_youve_wrote() {assert_suggestion_result("I love this project, it's impressing how many refactoring you've wrote in a limited amount of time.",- SimplePastToPastParticiple::default(),+ test_linter(),"I love this project, it's impressing how many refactoring you've written in a limited amount of time.",);}@@ -422,7 +429,7 @@ mod tests {fn correct_youve_ran_no_apostrophe() {assert_suggestion_result("after youve ran it, execute the file_mover.ps1 using powershell",- SimplePastToPastParticiple::default(),+ test_linter(),"after youve run it, execute the file_mover.ps1 using powershell",);}@@ -431,7 +438,7 @@ mod tests {fn correct_youd_wrote() {assert_suggestion_result("When I saw you'd wrote a terminal emulator I had to try it and so far it's amazing.",- SimplePastToPastParticiple::default(),+ test_linter(),"When I saw you'd written a terminal emulator I had to try it and so far it's amazing.",);}@@ -440,7 +447,7 @@ mod tests {fn correct_its_broke() {assert_suggestion_result("Not sure why it's broke for me but not for you.",- SimplePastToPastParticiple::default(),+ test_linter(),"Not sure why it's broken for me but not for you.",);}@@ -449,7 +456,7 @@ mod tests {fn correct_its_broke_no_apostrophe() {assert_suggestion_result("Now its broke and won't do batch images (decoding error).",- SimplePastToPastParticiple::default(),+ test_linter(),"Now its broken and won't do batch images (decoding error).",);}@@ -458,7 +465,7 @@ mod tests {fn correct_theyve_broke() {assert_suggestion_result("They've broke something again :D.",- SimplePastToPastParticiple::default(),+ test_linter(),"They've broken something again :D.",);}@@ -467,7 +474,7 @@ mod tests {fn correct_theyd_forgot() {assert_suggestion_result("they found the process they'd forgot they were running",- SimplePastToPastParticiple::default(),+ test_linter(),"they found the process they'd forgotten they were running",);}@@ -478,7 +485,7 @@ mod tests {fn dont_flag_being_woke() {assert_no_lints("Being woke to gender discrimination is difficult",- SimplePastToPastParticiple::default(),+ test_linter(),);}@@ -486,23 +493,20 @@ mod tests {fn dont_flag_be_woke() {assert_no_lints("So You Want To Be Woke. The path to becoming woke is hard",- SimplePastToPastParticiple::default(),+ test_linter(),);}#[test]fn dont_flag_id_did() {- assert_no_lints(- "Prop id did not match.",- SimplePastToPastParticiple::default(),- );+ assert_no_lints("Prop id did not match.", test_linter());}#[test]fn dont_flag_id_came() {assert_no_lints("I'm a longtime user of UniFi and site ID came around after my account was established.",- SimplePastToPastParticiple::default(),+ test_linter(),);}@@ -510,23 +514,17 @@ mod tests {fn dont_flag_id_went() {assert_no_lints("Could not determine debug ID went away after cleaning the dist/ before the build, so that's unrelated.",- SimplePastToPastParticiple::default(),+ test_linter(),);}#[test]fn dont_flag_have_lost_issue_3011() {- assert_no_lints(- "Elite Universities Have Lost Their Way",- SimplePastToPastParticiple::default(),- );+ assert_no_lints("Elite Universities Have Lost Their Way", test_linter());}#[test]fn dont_flag_has_lost() {- assert_no_lints(- "He has lost his keys.",- SimplePastToPastParticiple::default(),- );+ assert_no_lints("He has lost his keys.", test_linter());}}diff --git a/harper-core/src/linting/spell_check.rs b/harper-core/src/linting/spell_check.rsindex 8c7449dd3..7999d37d2 100644--- a/harper-core/src/linting/spell_check.rs+++ b/harper-core/src/linting/spell_check.rs@@ -168,6 +168,7 @@ mod tests {use super::SpellCheck;use crate::dict_word_metadata::DialectFlags;use crate::linting::Linter;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_good_and_bad_suggestions, assert_no_lints};use crate::spell::{Dictionary, FstDictionary, MergedDictionary, MutableDictionary};use crate::{@@ -175,6 +176,13 @@ mod tests {linting::tests::{assert_lint_count, assert_suggestion_result},};use crate::{DictWordMetadata, Document};+ use std::sync::Arc;++ create_test_pool!(+ SpellCheck,+ SpellCheck<Arc<FstDictionary>>,+ SpellCheck::new(FstDictionary::curated(), Dialect::American)+ );// Capitalization tests@@ -182,7 +190,7 @@ mod tests {fn america_capitalized() {assert_suggestion_result("The word america should be capitalized.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),"The word America should be capitalized.",);}@@ -191,11 +199,7 @@ mod tests {#[test]fn harper_automattic_capitalized() {- assert_lint_count(- "So should harper and automattic.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 2,- );+ assert_lint_count("So should harper and automattic.", test_linter(), 2);}#[test]@@ -229,7 +233,7 @@ mod tests {fn mum_and_mummy_not_just_commonwealth() {assert_lint_count("Mum's the word about that Egyptian mummy.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),0,);}@@ -245,11 +249,7 @@ mod tests {#[test]fn australian_verandah_in_american_dialect() {- assert_lint_count(- "Our house has a verandah.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("Our house has a verandah.", test_linter(), 1);}#[test]@@ -292,7 +292,7 @@ mod tests {fn australian_and_canadian_spellings_that_are_not_american() {assert_lint_count("In summer we sit on the verandah and eat yogourt.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),2,);}@@ -319,7 +319,7 @@ mod tests {fn australian_words_flagged_for_american_english() {assert_lint_count("There's an esky full of beers in the back of the ute.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),2,);}@@ -349,27 +349,19 @@ mod tests {// assert_suggestion_result(assert_suggestion_result("Abandonedware is abandoned. Do not bother submitting issues about the empty page bug. Author moved to greener pastures",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),"Abandonware is abandoned. Do not bother submitting issues about the empty page bug. Author moved to greener pastures",);}#[test]fn afterwards_not_us() {- assert_lint_count(- "afterwards",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("afterwards", test_linter(), 1);}#[test]fn afterward_is_us() {- assert_lint_count(- "afterward",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 0,- );+ assert_lint_count("afterward", test_linter(), 0);}#[test]@@ -523,11 +515,7 @@ mod tests {#[test]fn flag_prepone_in_non_indian_english() {- assert_lint_count(- "We had to prepone the meeting",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("We had to prepone the meeting", test_linter(), 1);}#[test]@@ -540,80 +528,47 @@ mod tests {#[test]fn dont_flag_pr() {- assert_no_lints(- "PR",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- );+ assert_no_lints("PR", test_linter());}#[test]fn no_improper_suggestion_for_macos() {- assert_good_and_bad_suggestions(- "MacOS",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- &["macOS"],- &["MacOS"],- );+ assert_good_and_bad_suggestions("MacOS", test_linter(), &["macOS"], &["MacOS"]);}#[test]fn allows_parenthetical_plural_s() {- assert_no_lints(- "Please ask each person(s) to sign.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- );+ assert_no_lints("Please ask each person(s) to sign.", test_linter());}#[test]fn allows_multiple_parenthetical_plural_s_markers() {- assert_no_lints(- "Review the person(s) and document(s).",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- );+ assert_no_lints("Review the person(s) and document(s).", test_linter());}#[test]fn allows_uppercase_parenthetical_plural_s() {- assert_no_lints(- "CONTACT THE PERSON(S).",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- );+ assert_no_lints("CONTACT THE PERSON(S).", test_linter());}#[test]fn still_flags_misspelled_word_before_parenthetical_plural_s() {- assert_lint_count(- "Please ask each persson(s) to sign.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("Please ask each persson(s) to sign.", test_linter(), 1);}#[test]fn still_flags_parenthetical_s_without_preceding_word() {- assert_lint_count(- "Please mark (s) on the form.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("Please mark (s) on the form.", test_linter(), 1);}#[test]fn still_flags_spaced_parenthetical_s() {- assert_lint_count(- "Please ask each person (s) to sign.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("Please ask each person (s) to sign.", test_linter(), 1);}#[test]fn still_flags_longer_parenthetical_marker() {- assert_lint_count(- "Please ask each person(ss) to sign.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- 1,- );+ assert_lint_count("Please ask each person(ss) to sign.", test_linter(), 1);}// Tests that were previously in `spell/mod.rs`@@ -623,11 +578,7 @@ mod tests {// is_ou_misspelling#[test]fn suggest_color_for_colour_lowercase() {- assert_suggestion_result(- "colour",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "color",- );+ assert_suggestion_result("colour", test_linter(), "color");}#[test]@@ -642,11 +593,7 @@ mod tests {// titlecase#[test]fn suggest_color_for_colour_titlecase() {- assert_suggestion_result(- "Colour",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "Color",- );+ assert_suggestion_result("Colour", test_linter(), "Color");}#[test]@@ -663,11 +610,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_color_for_colour_all_caps() {- assert_suggestion_result(- "COLOUR",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "COLOR",- );+ assert_suggestion_result("COLOUR", test_linter(), "COLOR");}#[test]@@ -695,11 +638,7 @@ mod tests {#[test]fn suggest_realize_for_realise() {- assert_suggestion_result(- "realise",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "realize",- );+ assert_suggestion_result("realise", test_linter(), "realize");}#[test]@@ -715,11 +654,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_realize_for_realise_titlecase() {- assert_suggestion_result(- "Realise",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "Realize",- );+ assert_suggestion_result("Realise", test_linter(), "Realize");}#[test]@@ -735,11 +670,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_realize_for_realise_all_caps() {- assert_suggestion_result(- "REALISE",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "REALIZE",- );+ assert_suggestion_result("REALISE", test_linter(), "REALIZE");}// s/c as in defense/defence@@ -754,11 +685,7 @@ mod tests {#[test]fn suggest_defense_for_defence() {- assert_suggestion_result(- "defence",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "defense",- );+ assert_suggestion_result("defence", test_linter(), "defense");}#[test]@@ -772,11 +699,7 @@ mod tests {#[test]fn suggest_defence_for_defense_titlecase() {- assert_suggestion_result(- "Defence",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "Defense",- );+ assert_suggestion_result("Defence", test_linter(), "Defense");}#[test]@@ -792,11 +715,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_defence_for_defense_all_caps() {- assert_suggestion_result(- "DEFENCE",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "DEFENSE",- );+ assert_suggestion_result("DEFENCE", test_linter(), "DEFENSE");}// k/c as in skeptic/sceptic@@ -811,11 +730,7 @@ mod tests {#[test]fn suggest_skeptic_for_sceptic() {- assert_suggestion_result(- "sceptic",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "skeptic",- );+ assert_suggestion_result("sceptic", test_linter(), "skeptic");}#[test]@@ -830,11 +745,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_skeptic_for_sceptic_titlecase() {- assert_suggestion_result(- "Sceptic",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "Skeptic",- );+ assert_suggestion_result("Sceptic", test_linter(), "Skeptic");}#[test]@@ -850,22 +761,14 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_sceptic_for_skeptic_all_caps() {- assert_suggestion_result(- "SCEPTIC",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "SKEPTIC",- );+ assert_suggestion_result("SCEPTIC", test_linter(), "SKEPTIC");}// is_er_misspelling// as in meter/metre#[test]fn suggest_centimeter_for_centimetre() {- assert_suggestion_result(- "centimetre",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "centimeter",- );+ assert_suggestion_result("centimetre", test_linter(), "centimeter");}#[test]@@ -879,11 +782,7 @@ mod tests {#[test]fn suggest_centimeter_for_centimetre_titlecase() {- assert_suggestion_result(- "Centimetre",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "Centimeter",- );+ assert_suggestion_result("Centimetre", test_linter(), "Centimeter");}#[test]@@ -899,11 +798,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_centimeter_for_centimetre_all_caps() {- assert_suggestion_result(- "CENTIMETRE",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "CENTIMETER",- );+ assert_suggestion_result("CENTIMETRE", test_linter(), "CENTIMETER");}#[test]@@ -920,11 +815,7 @@ mod tests {// as in traveller/traveler#[test]fn suggest_traveler_for_traveller() {- assert_suggestion_result(- "traveller",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "traveler",- );+ assert_suggestion_result("traveller", test_linter(), "traveler");}#[test]@@ -938,11 +829,7 @@ mod tests {#[test]fn suggest_traveler_for_traveller_titlecase() {- assert_suggestion_result(- "Traveller",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "Traveler",- );+ assert_suggestion_result("Traveller", test_linter(), "Traveler");}#[test]@@ -958,11 +845,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_traveler_for_traveller_all_caps() {- assert_suggestion_result(- "TRAVELLER",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "TRAVELER",- );+ assert_suggestion_result("TRAVELLER", test_linter(), "TRAVELER");}#[test]@@ -991,7 +874,7 @@ mod tests {fn suggest_gray_for_grey_in_american() {assert_suggestion_result("It's a greyscale photo.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),"It's a grayscale photo.",);}@@ -1010,7 +893,7 @@ mod tests {fn suggest_gray_for_grey_in_american_titlecase() {assert_suggestion_result("It's a Greyscale Photo.",- SpellCheck::new(FstDictionary::curated(), Dialect::American),+ test_linter(),"It's a Grayscale Photo.",);}@@ -1028,11 +911,7 @@ mod tests {#[test]#[ignore = "known failure due to bug"]fn suggest_gray_for_grey_in_american_all_caps() {- assert_suggestion_result(- "GREY",- SpellCheck::new(FstDictionary::curated(), Dialect::American),- "GRAY",- );+ assert_suggestion_result("GREY", test_linter(), "GRAY");}// Tests for non-dialectal misspelling patterns@@ -1097,10 +976,7 @@ mod tests {#[test]fn allows_informal_laughter() {for source in ["hahah", "hahaha", "hahahah", "Hahahah", "HAHAHA"] {- assert_no_lints(- source,- SpellCheck::new(FstDictionary::curated(), Dialect::American),- );+ assert_no_lints(source, test_linter());}}}diff --git a/harper-core/src/linting/then_than.rs b/harper-core/src/linting/then_than.rsindex 08ca787e1..2ef3ce7fd 100644--- a/harper-core/src/linting/then_than.rs+++ b/harper-core/src/linting/then_than.rs@@ -112,18 +112,21 @@ impl ExprLinter for ThenThan {#[cfg(test)]mod tests {use super::ThenThan;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::{assert_lint_count, assert_suggestion_result};+ create_test_pool!(ThenThan, ThenThan, ThenThan::default());+#[test]fn allows_back_then() {- assert_lint_count("I was a gross kid back then.", ThenThan::default(), 0);+ assert_lint_count("I was a gross kid back then.", test_linter(), 0);}#[test]fn catches_shorter_then() {assert_suggestion_result("One was shorter then the other.",- ThenThan::default(),+ test_linter(),"One was shorter than the other.",);}@@ -132,7 +135,7 @@ mod tests {fn catches_better_then() {assert_suggestion_result("One was better then the other.",- ThenThan::default(),+ test_linter(),"One was better than the other.",);}@@ -141,7 +144,7 @@ mod tests {fn catches_longer_then() {assert_suggestion_result("One was longer then the other.",- ThenThan::default(),+ test_linter(),"One was longer than the other.",);}@@ -150,7 +153,7 @@ mod tests {fn catches_less_then() {assert_suggestion_result("I eat less then you.",- ThenThan::default(),+ test_linter(),"I eat less than you.",);}@@ -159,7 +162,7 @@ mod tests {fn catches_more_then() {assert_suggestion_result("I eat more then you.",- ThenThan::default(),+ test_linter(),"I eat more than you.",);}@@ -168,7 +171,7 @@ mod tests {fn stronger_should_change() {assert_suggestion_result("a chain is no stronger then its weakest link",- ThenThan::default(),+ test_linter(),"a chain is no stronger than its weakest link",);}@@ -177,21 +180,21 @@ mod tests {fn half_a_loaf_should_change() {assert_suggestion_result("half a loaf is better then no bread",- ThenThan::default(),+ test_linter(),"half a loaf is better than no bread",);}#[test]fn then_everyone_clapped_should_be_allowed() {- assert_lint_count("and then everyone clapped", ThenThan::default(), 0);+ assert_lint_count("and then everyone clapped", test_linter(), 0);}#[test]fn crazier_than_rat_should_change() {assert_suggestion_result("crazier then a shithouse rat",- ThenThan::default(),+ test_linter(),"crazier than a shithouse rat",);}@@ -200,7 +203,7 @@ mod tests {fn poke_in_eye_should_change() {assert_suggestion_result("better then a poke in the eye with a sharp stick",- ThenThan::default(),+ test_linter(),"better than a poke in the eye with a sharp stick",);}@@ -209,38 +212,38 @@ mod tests {fn other_then_should_change() {assert_suggestion_result("There was no one other then us at the campsite.",- ThenThan::default(),+ test_linter(),"There was no one other than us at the campsite.",);}#[test]fn allows_and_then() {- assert_lint_count("And then we left.", ThenThan::default(), 0);+ assert_lint_count("And then we left.", test_linter(), 0);}#[test]fn allows_this_then() {- assert_lint_count("Do this then that.", ThenThan::default(), 0);+ assert_lint_count("Do this then that.", test_linter(), 0);}#[test]fn allows_issue_720() {assert_lint_count("And if just one of those is set incorrectly or it has the tiniest bit of dirt inside then that will wreak havoc with the engine's running ability.",- ThenThan::default(),+ test_linter(),0,);- assert_lint_count("So let's check it out then.", ThenThan::default(), 0);+ assert_lint_count("So let's check it out then.", test_linter(), 0);assert_lint_count("And if just the tiniest bit of dirt gets inside then that will wreak havoc.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("He was always a top student in school but then his argument is that grades don't define intelligence.",- ThenThan::default(),+ test_linter(),0,);}@@ -249,7 +252,7 @@ mod tests {fn allows_issue_744() {assert_lint_count("So then after talking about how he would, he didn't.",- ThenThan::default(),+ test_linter(),0,);}@@ -258,22 +261,22 @@ mod tests {fn issue_720_school_but_then_his() {assert_lint_count("She loved the atmosphere of the school but then his argument is that it lacks proper resources for students.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("The teacher praised the efforts of the school but then his argument is that the curriculum needs to be updated.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("They were excited about the new program at school but then his argument is that it won't be effective without proper training.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("The community supported the school but then his argument is that funding is still a major issue.",- ThenThan::default(),+ test_linter(),0,);}@@ -282,27 +285,27 @@ mod tests {fn issue_720_so_then_these_resistors() {assert_lint_count("So then these resistors are connected up in parallel to reduce the overall resistance.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("So then these resistors are connected up to ensure the current flows properly.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("So then these resistors are connected up to achieve the desired voltage drop.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("So then these resistors are connected up to demonstrate the principles of series and parallel circuits.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("So then these resistors are connected up to optimize the circuit's performance.",- ThenThan::default(),+ test_linter(),0,);}@@ -311,27 +314,27 @@ mod tests {fn issue_720_yes_so_then_sorry() {assert_lint_count("Yes so then sorry you didn't receive the memo about the meeting changes.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("Yes so then sorry you had to wait so long for a response from our team.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("Yes so then sorry you felt left out during the discussion; we value your input.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("Yes so then sorry you missed the deadline; we can discuss an extension.",- ThenThan::default(),+ test_linter(),0,);assert_lint_count("Yes so then sorry you encountered issues with the software; let me help you troubleshoot.",- ThenThan::default(),+ test_linter(),0,);}@@ -340,7 +343,7 @@ mod tests {fn more_talented_then_her_issue_720() {assert_suggestion_result("He was more talented then her at writing code.",- ThenThan::default(),+ test_linter(),"He was more talented than her at writing code.",);}@@ -349,7 +352,7 @@ mod tests {fn simpler_then_hers_issue_720() {assert_suggestion_result("The design was simpler then hers in layout and color scheme.",- ThenThan::default(),+ test_linter(),"The design was simpler than hers in layout and color scheme.",);}@@ -358,7 +361,7 @@ mod tests {fn earlier_then_him_issue_720() {assert_suggestion_result("We arrived earlier then him at the event.",- ThenThan::default(),+ test_linter(),"We arrived earlier than him at the event.",);}@@ -367,7 +370,7 @@ mod tests {fn more_robust_then_his_issue_720() {assert_suggestion_result("This approach is more robust then his for handling edge cases.",- ThenThan::default(),+ test_linter(),"This approach is more robust than his for handling edge cases.",);}@@ -376,7 +379,7 @@ mod tests {fn patch_more_recently_then_last_week_issue_720() {assert_suggestion_result("We submitted the patch more recently then last week, so they should have it already.",- ThenThan::default(),+ test_linter(),"We submitted the patch more recently than last week, so they should have it already.",);}@@ -385,7 +388,7 @@ mod tests {fn allows_well_then() {assert_lint_count("Well then we're just going to raise all of these taxes",- ThenThan::default(),+ test_linter(),0,);}@@ -394,7 +397,7 @@ mod tests {fn allows_nervous_then() {assert_lint_count("I think both of us were getting nervous then because the system would have automatically aborted.",- ThenThan::default(),+ test_linter(),0,);}@@ -403,7 +406,7 @@ mod tests {fn flags_stupider_then_and_more_and_less_stupid_then() {assert_lint_count("He was stupider then her but she was more stupid then some. Then again he was less stupid then some too.",- ThenThan::default(),+ test_linter(),3,);}@@ -412,7 +415,7 @@ mod tests {fn patch_worse_then() {assert_suggestion_result("He was worse then her at writing code.",- ThenThan::default(),+ test_linter(),"He was worse than her at writing code.",);}@@ -421,7 +424,7 @@ mod tests {fn patch_rather_then() {assert_suggestion_result("If copy-paste has to be prevented, I'd prefer it if paste rather then copy would be disabled",- ThenThan::default(),+ test_linter(),"If copy-paste has to be prevented, I'd prefer it if paste rather than copy would be disabled",);}@@ -430,7 +433,7 @@ mod tests {fn patch_easier_said_then_done() {assert_suggestion_result("This is currently easier said then done because you cannot press Ctrl+A in the debug console",- ThenThan::default(),+ test_linter(),"This is currently easier said than done because you cannot press Ctrl+A in the debug console",);}@@ -439,7 +442,7 @@ mod tests {fn patch_every_now_and_than() {assert_suggestion_result("I was testing every now and than after an upgrade on the home assistant plugin.",- ThenThan::default(),+ test_linter(),"I was testing every now and then after an upgrade on the home assistant plugin.",);}@@ -448,7 +451,7 @@ mod tests {fn patch_until_than() {assert_suggestion_result("For the case anyone else ever hits this and the problem is not solved until than, this is a working workaround for the problem",- ThenThan::default(),+ test_linter(),"For the case anyone else ever hits this and the problem is not solved until then, this is a working workaround for the problem",);}@@ -457,7 +460,7 @@ mod tests {fn patch_now_and_than() {assert_suggestion_result("sounds good if golang-set becomes an issue between now and than…just let me know!",- ThenThan::default(),+ test_linter(),"sounds good if golang-set becomes an issue between now and then…just let me know!",);}diff --git a/harper-core/src/linting/there_is_agreement.rs b/harper-core/src/linting/there_is_agreement.rsindex e351c0d66..3f4e62b63 100644--- a/harper-core/src/linting/there_is_agreement.rs+++ b/harper-core/src/linting/there_is_agreement.rs@@ -487,13 +487,21 @@ fn handle_question<D: Dictionary>(#[cfg(test)]mod tests {use crate::{- linting::tests::{- assert_good_and_bad_suggestions, assert_no_lints, assert_suggestion_result,+ linting::{+ create_test_pool,+ tests::{assert_good_and_bad_suggestions, assert_no_lints, assert_suggestion_result},},spell::FstDictionary,};use super::ThereIsAgreement;+ use std::sync::Arc;++ create_test_pool!(+ ThereIsAgreement,+ ThereIsAgreement<Arc<FstDictionary>>,+ ThereIsAgreement::new(FstDictionary::curated())+ );// basic functionality@@ -501,7 +509,7 @@ mod tests {fn statement_present_pl_regular() {assert_good_and_bad_suggestions("there is things",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there are things", "there is a thing"],&[],);@@ -511,7 +519,7 @@ mod tests {fn statement_present_sg_irregular() {assert_good_and_bad_suggestions("there are person",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there are people", "there is a person"],&[],);@@ -521,7 +529,7 @@ mod tests {fn statement_present_theres_pl() {assert_good_and_bad_suggestions("there's secrets",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there are secrets", "there's a secret"],&[],);@@ -531,7 +539,7 @@ mod tests {fn statement_past_pl_vowel() {assert_good_and_bad_suggestions("there was ideas",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there were ideas", "there was an idea"],&[],);@@ -541,7 +549,7 @@ mod tests {fn statement_past_sg() {assert_good_and_bad_suggestions("there were child",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there were children", "there was a child"],&[],);@@ -552,7 +560,7 @@ mod tests {fn question_pres_sg() {assert_good_and_bad_suggestions("are there man",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["are there men", "is there a man"],&[],);@@ -562,7 +570,7 @@ mod tests {fn question_pres_pl() {assert_good_and_bad_suggestions("is there women",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["are there women", "is there a woman"],&[],);@@ -572,7 +580,7 @@ mod tests {fn question_past_sg() {assert_good_and_bad_suggestions("were there cow",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["were there cows", "was there a cow"],&[],);@@ -582,7 +590,7 @@ mod tests {fn question_past_pl() {assert_good_and_bad_suggestions("were there elephant",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["were there elephants", "was there an elephant"],&[],);@@ -590,25 +598,19 @@ mod tests {#[test]fn dont_flag_there_are_hyphenated_compound_starts_singular() {- assert_no_lints(- "there are function-like macros",- ThereIsAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("there are function-like macros", test_linter());}#[test]fn dont_flag_there_are_open_compound_starts_singular() {- assert_no_lints(- "there are config errors",- ThereIsAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("there are config errors", test_linter());}#[test]fn a_or_an_depends_on_dialect_herb() {assert_good_and_bad_suggestions("there's herbs.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there are herbs.",// "there'ss a herb.", // TODO: This module does not yet accept a `Dialect`, `American` is hard-coded for now.@@ -622,7 +624,7 @@ mod tests {fn a_or_an_depends_on_dialect_hotel() {assert_good_and_bad_suggestions("There are hotel.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["There are hotels.","There is a hotel.",@@ -640,7 +642,7 @@ mod tests {fn fix_there_is_errors() {assert_good_and_bad_suggestions("Hi, when I make the code, there is errors",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Hi, when I make the code, there are errors","Hi, when I make the code, there is an error",@@ -653,7 +655,7 @@ mod tests {fn fix_there_is_warnings() {assert_good_and_bad_suggestions("There is warnings from kotlin and dart, as reference: Elvis operator (?:) always returns the left operand of non-nullable type String.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["There are warnings from kotlin and dart, as reference: Elvis operator (?:) always returns the left operand of non-nullable type String.","There is a warning from kotlin and dart, as reference: Elvis operator (?:) always returns the left operand of non-nullable type String.",@@ -666,7 +668,7 @@ mod tests {fn fix_there_is_problems() {assert_good_and_bad_suggestions("Problem is that if there is a project that has a csproj file, then there is problems with the history folder.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Problem is that if there is a project that has a csproj file, then there are problems with the history folder.","Problem is that if there is a project that has a csproj file, then there is a problem with the history folder.",@@ -680,7 +682,7 @@ mod tests {fn fix_there_is_commands() {assert_good_and_bad_suggestions("Additionally if there is Commands that can be used on multiple Resources at the same time.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Additionally if there are Commands that can be used on multiple Resources at the same time.","Additionally if there is a Command that can be used on multiple Resources at the same time.",@@ -693,7 +695,7 @@ mod tests {fn fix_there_is_values() {assert_suggestion_result("This mean there would not be a single cache, but as many caches as there is values for the second argument.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"This mean there would not be a single cache, but as many caches as there are values for the second argument.",);}@@ -702,7 +704,7 @@ mod tests {fn fix_there_is_strings() {assert_good_and_bad_suggestions("I can image other cases (tools different from SPSS) in which there is strings in both sides of the dictionary",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["I can image other cases (tools different from SPSS) in which there are strings in both sides of the dictionary","I can image other cases (tools different from SPSS) in which there is a string in both sides of the dictionary",@@ -715,7 +717,7 @@ mod tests {fn fix_there_is_things() {assert_good_and_bad_suggestions("even though we can check whether there is things running in Node, we can not do it for Chromium's message loops",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["even though we can check whether there are things running in Node, we can not do it for Chromium's message loops","even though we can check whether there is a thing running in Node, we can not do it for Chromium's message loops",@@ -739,12 +741,12 @@ mod tests {// );assert_suggestion_result("there is people making projects, there is people doing tutorials",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"there are people making projects, there are people doing tutorials",);assert_suggestion_result("there is people making projects, there is people doing tutorials",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"there is a person making projects, there is a person doing tutorials",);}@@ -753,7 +755,7 @@ mod tests {fn fix_there_is_instructions() {assert_good_and_bad_suggestions("I am just wondering if there is instructions somewhere for handling deep linking while using Redux.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["I am just wondering if there are instructions somewhere for handling deep linking while using Redux.","I am just wondering if there is an instruction somewhere for handling deep linking while using Redux.",@@ -766,7 +768,7 @@ mod tests {fn fix_there_is_packages() {assert_suggestion_result("if there is packages that handle such protocols installed",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"if there are packages that handle such protocols installed",);}@@ -780,7 +782,7 @@ mod tests {fn dont_flag_there_is_people_who_have_done_xyz() {assert_no_lints("The main expectation there is people who have a deprecated app installed will then get an error if it's disabled",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -789,7 +791,7 @@ mod tests {fn dont_flag_there_is_packages_part_of_dir() {assert_no_lints("For example there is packages/vite/src/node , but no packages/vite/src/deno",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -799,7 +801,7 @@ mod tests {fn fix_there_are_bug() {assert_good_and_bad_suggestions("there are bug in svelte 3.0 that axios from 0.22.0 version undefined",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there is a bug in svelte 3.0 that axios from 0.22.0 version undefined","there are bugs in svelte 3.0 that axios from 0.22.0 version undefined",@@ -812,7 +814,7 @@ mod tests {fn fix_there_are_description() {assert_good_and_bad_suggestions("there are description regarding thread safety in zmq document.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there is a description regarding thread safety in zmq document.","there are descriptions regarding thread safety in zmq document.",@@ -825,7 +827,7 @@ mod tests {fn fix_there_are_issue() {assert_good_and_bad_suggestions("Seems like if there are issue with OpenAI, it is still trying to call chat completion and giving type error.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Seems like if there are issues with OpenAI, it is still trying to call chat completion and giving type error.","Seems like if there is an issue with OpenAI, it is still trying to call chat completion and giving type error.",@@ -839,7 +841,7 @@ mod tests {fn fix_there_are_problem() {assert_good_and_bad_suggestions("There are problem with official serving docker image gpu version",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["There is a problem with official serving docker image gpu version","There are problems with official serving docker image gpu version",@@ -854,7 +856,7 @@ mod tests {fn dont_flag_there_are_dep_conflicts() {assert_no_lints("Wrong advice when there are dependency conflicts",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -862,7 +864,7 @@ mod tests {fn dont_flag_there_are_dep_errs() {assert_no_lints("If there are dependency errors they will be immediately logged out to you.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -871,7 +873,7 @@ mod tests {fn dont_flag_there_are_def_syntax_errs() {assert_no_lints("New Campaign Properties dialog loses changes if there are definition syntax errors",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -879,7 +881,7 @@ mod tests {fn dont_flag_there_are_description_and_instruction_keys() {assert_no_lints("There are description and instruction keys for the classes.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -887,7 +889,7 @@ mod tests {fn dont_flag_there_are_function_like() {assert_no_lints("clang-format indents class member functions oddly if there are function-like macro invocations",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -897,7 +899,7 @@ mod tests {fn fix_there_was_configs() {assert_good_and_bad_suggestions("I did see that there was configs for it before but it isn't in the configs anymore.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["I did see that there were configs for it before but it isn't in the configs anymore.","I did see that there was a config for it before but it isn't in the configs anymore.",@@ -910,7 +912,7 @@ mod tests {fn fix_there_was_examples() {assert_good_and_bad_suggestions("It would be awesome if there was examples on how to include inline citations",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["It would be awesome if there were examples on how to include inline citations","It would be awesome if there was an example on how to include inline citations",@@ -923,7 +925,7 @@ mod tests {fn fix_there_was_functions() {assert_good_and_bad_suggestions("I noticed in the AXP2101_Class for the unified library that there was functions like \"isPekeyShortPressIrq()\"",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["I noticed in the AXP2101_Class for the unified library that there were functions like \"isPekeyShortPressIrq()\"","I noticed in the AXP2101_Class for the unified library that there was a function like \"isPekeyShortPressIrq()\"",@@ -936,7 +938,7 @@ mod tests {fn fix_there_was_issues() {assert_good_and_bad_suggestions("Restored to a Snapshot, but there was issues with Hyprland.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Restored to a Snapshot, but there were issues with Hyprland.","Restored to a Snapshot, but there was an issue with Hyprland.",@@ -949,7 +951,7 @@ mod tests {fn fix_there_was_settings() {assert_good_and_bad_suggestions("I also tried creating a fresh page on the same site, and there was settings but only 2 pages of settings",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["I also tried creating a fresh page on the same site, and there were settings but only 2 pages of settings","I also tried creating a fresh page on the same site, and there was a setting but only 2 pages of settings",@@ -964,7 +966,7 @@ mod tests {fn fix_there_were_function() {assert_good_and_bad_suggestions("Instead, it would be helpful if there were function in the autoloader capable of taking the a list of names of packages to enable.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Instead, it would be helpful if there were functions in the autoloader capable of taking the a list of names of packages to enable.","Instead, it would be helpful if there was a function in the autoloader capable of taking the a list of names of packages to enable.",@@ -979,7 +981,7 @@ mod tests {fn fix_there_were_hint() {assert_good_and_bad_suggestions("there were hint that this could break the build",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there were hints that this could break the build","there was a hint that this could break the build",@@ -992,7 +994,7 @@ mod tests {fn fix_there_were_issue() {assert_good_and_bad_suggestions("there were issue with using venv and it was pulled",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there were issues with using venv and it was pulled","there was an issue with using venv and it was pulled",@@ -1006,7 +1008,7 @@ mod tests {fn fix_there_were_problem_about() {assert_good_and_bad_suggestions("there were problem about version but this error is solved by correcting version in these files",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there were problems about version but this error is solved by correcting version in these files","there was a problem about version but this error is solved by correcting version in these files",@@ -1020,7 +1022,7 @@ mod tests {fn fix_there_were_problem_with() {assert_good_and_bad_suggestions("there were problem with page alignment crossing",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there were problems with page alignment crossing","there was a problem with page alignment crossing",@@ -1036,7 +1038,7 @@ mod tests {fn dont_flag_alice_there_were_two() {assert_no_lints("This time there were two little shrieks, and more sounds of broken glass.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1044,7 +1046,7 @@ mod tests {fn dont_flag_gatsby_there_were_twinkle_bells() {assert_no_lints("When he realized what I was talking about, that there were twinkle-bells of sunshine in the room, he smiled like a weather man",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1053,7 +1055,7 @@ mod tests {fn dont_flag_gatsby_there_were_a_and_b() {assert_no_lints("Of theatrical people there were Gus Waize and Horace O’Donavan and Lester Myer and George Duckweed and Francis",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1063,7 +1065,7 @@ mod tests {fn fix_is_there_apps() {assert_good_and_bad_suggestions("Ok, but is there apps that actually do that?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Ok, but are there apps that actually do that?","Ok, but is there an app that actually do that?",@@ -1076,7 +1078,7 @@ mod tests {fn fix_is_there_ideas() {assert_suggestion_result("Is there ideas to make regular page to listen for api (POST/PUT/.. etc requests)",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"Are there ideas to make regular page to listen for api (POST/PUT/.. etc requests)",);}@@ -1085,7 +1087,7 @@ mod tests {fn fix_is_there_people() {assert_suggestion_result("please guys tell me, is there people really making money with bot?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"please guys tell me, are there people really making money with bot?",);}@@ -1094,7 +1096,7 @@ mod tests {fn fix_is_there_solutions() {assert_good_and_bad_suggestions("Run-as binary without the suid bit set, is there solutions?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Run-as binary without the suid bit set, are there solutions?","Run-as binary without the suid bit set, is there a solution?",@@ -1107,7 +1109,7 @@ mod tests {fn fix_is_there_things() {assert_suggestion_result("is there things you could change to make it a more general product",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),"are there things you could change to make it a more general product",);}@@ -1116,7 +1118,7 @@ mod tests {fn fix_is_there_tools() {assert_good_and_bad_suggestions("Is there tools or documentation how to recover / rebuild /run fsck on the failed replicas.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Are there tools or documentation how to recover / rebuild /run fsck on the failed replicas.","Is there a tool or documentation how to recover / rebuild /run fsck on the failed replicas.",@@ -1132,7 +1134,7 @@ mod tests {fn fix_are_there_problem() {assert_good_and_bad_suggestions("Is it just the namespace or are there problem in the use statements as well?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Is it just the namespace or are there problems in the use statements as well?","Is it just the namespace or is there a problem in the use statements as well?",@@ -1145,7 +1147,7 @@ mod tests {fn fix_are_there_solution() {assert_good_and_bad_suggestions("Are there solution for making lsws using h2 protocol in client browsers?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Are there solutions for making lsws using h2 protocol in client browsers?","Is there a solution for making lsws using h2 protocol in client browsers?",@@ -1158,7 +1160,7 @@ mod tests {fn fix_are_there_solution_slash_workaround() {assert_good_and_bad_suggestions("are there solution/workaround ?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&[// TODO the ideal fix pluralizes each word separated by `/`// "are there solutions/workarounds ?",@@ -1173,7 +1175,7 @@ mod tests {fn fix_are_there_concept() {assert_good_and_bad_suggestions("So, what is a external interface in C++? are there concept of interface in C++?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["So, what is a external interface in C++? are there concepts of interface in C++?","So, what is a external interface in C++? is there a concept of interface in C++?",@@ -1186,7 +1188,7 @@ mod tests {fn fix_are_there_object() {assert_good_and_bad_suggestions("He check are there object with same id, if there is no object with same id he creates new and add to array",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["He check are there objects with same id, if there is no object with same id he creates new and add to array","He check is there an object with same id, if there is no object with same id he creates new and add to array",@@ -1200,7 +1202,7 @@ mod tests {fn fix_are_there_variable() {assert_good_and_bad_suggestions("Are there variable in side it or is it some sort of dataset?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Are there variables in side it or is it some sort of dataset?","Is there a variable in side it or is it some sort of dataset?",@@ -1213,17 +1215,14 @@ mod tests {#[test]fn ignore_are_there_answer_generation_errors() {- assert_no_lints(- "Are there Answer Generation Errors?",- ThereIsAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("Are there Answer Generation Errors?", test_linter());}#[test]fn ignore_are_there_application_objects() {assert_no_lints("Are there application objects assigned to non-existent sites",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1231,7 +1230,7 @@ mod tests {fn ignore_are_there_code_files() {assert_no_lints("Why are there code files more than 10k lines long?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1239,7 +1238,7 @@ mod tests {fn ignore_are_there_error_logs() {assert_no_lints("Are there error logs in your worker when flows fail?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1247,7 +1246,7 @@ mod tests {fn ignore_are_there_tool_specific() {assert_no_lints("Are there tool specific constraints for RM tool exchange for EA?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1257,7 +1256,7 @@ mod tests {fn fix_was_there_bugs() {assert_good_and_bad_suggestions("Was there bugs, and goofed-up quests?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Were there bugs, and goofed-up quests?","Was there a bug, and goofed-up quests?",@@ -1270,7 +1269,7 @@ mod tests {fn fix_was_there_hints() {assert_good_and_bad_suggestions("Was there hints in the game that points you to it?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Were there hints in the game that points you to it?","Was there a hint in the game that points you to it?",@@ -1283,7 +1282,7 @@ mod tests {fn fix_was_there_issues() {assert_good_and_bad_suggestions("I saw you closed that PR, was there issues getting it merged upstream?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["I saw you closed that PR, were there issues getting it merged upstream?","I saw you closed that PR, was there an issue getting it merged upstream?",@@ -1296,7 +1295,7 @@ mod tests {fn fix_was_there_problems() {assert_good_and_bad_suggestions("Was there problems with other files that you had written to the SD card (PRG/CRT)?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Were there problems with other files that you had written to the SD card (PRG/CRT)?","Was there a problem with other files that you had written to the SD card (PRG/CRT)?",@@ -1312,7 +1311,7 @@ mod tests {fn dont_flag_last_time_i_was_there() {assert_no_lints("Last time I was there flags were on almost every house or fence.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1321,7 +1320,7 @@ mod tests {fn dont_flag_the_grate_was_there() {assert_no_lints("Saying the grate was there helps him avoid a lawsuit.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1330,7 +1329,7 @@ mod tests {fn dont_flag_when_he_was_there() {assert_no_lints("When he was there tips were going way, way up.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1340,7 +1339,7 @@ mod tests {fn were_there_description() {assert_good_and_bad_suggestions("Were there pictures of the Primarchs around before then? Were there description?",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Were there pictures of the Primarchs around before then? Were there descriptions?","Were there pictures of the Primarchs around before then? Was there a description?",@@ -1353,17 +1352,14 @@ mod tests {#[test]fn font_flag_were_there_bomb_drills() {- assert_no_lints(- "Were there bomb drills in school?",- ThereIsAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("Were there bomb drills in school?", test_linter());}#[test]fn dont_flag_were_there_set_rules() {assert_no_lints("For instance, were there set rules as to the funds that candidates would have to have acquired",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1371,7 +1367,7 @@ mod tests {fn dont_flag_were_there_tour_buses() {assert_no_lints("Were there tour buses and different hotels and parties each night? Yep.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}@@ -1381,7 +1377,7 @@ mod tests {fn fix_theres_children() {assert_good_and_bad_suggestions("now, check whether there's children",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["now, check whether there's a child","now, check whether there are children",@@ -1394,7 +1390,7 @@ mod tests {fn fix_theres_ideas() {assert_good_and_bad_suggestions("there's ideas how it should behave for some media etc.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there's an idea how it should behave for some media etc.","there are ideas how it should behave for some media etc.",@@ -1407,7 +1403,7 @@ mod tests {fn fix_theres_people() {assert_good_and_bad_suggestions("Currently there's people helping out, and it's fairly easy to find someone if you need something.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["Currently there are people helping out, and it's fairly easy to find someone if you need something.","Currently there's a person helping out, and it's fairly easy to find someone if you need something.",@@ -1420,7 +1416,7 @@ mod tests {fn fix_theres_problems() {assert_good_and_bad_suggestions("there's problems when using WSL::Ubuntu",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["there are problems when using WSL::Ubuntu","there's a problem when using WSL::Ubuntu",@@ -1433,7 +1429,7 @@ mod tests {fn fix_theres_things() {assert_good_and_bad_suggestions("If there's things you love/hate about Vidstack please let us know",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["If there are things you love/hate about Vidstack please let us know","If there's a thing you love/hate about Vidstack please let us know",@@ -1446,7 +1442,7 @@ mod tests {fn fix_theres_urls() {assert_good_and_bad_suggestions("so you're not suprised if there's urls missing or your data isn't being refreshed daily",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),&["so you're not suprised if there are urls missing or your data isn't being refreshed daily","so you're not suprised if there's a url missing or your data isn't being refreshed daily",@@ -1460,23 +1456,20 @@ mod tests {fn fix_browser_console_3066() {assert_no_lints("Finally, I’ve checked the browser’s developer console for any JavaScript errors, but there are none.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}#[test]fn fix_there_was_none_3066() {- assert_no_lints(- "There were none.",- ThereIsAgreement::new(FstDictionary::curated()),- );+ assert_no_lints("There were none.", test_linter());}#[test]fn fix_none_related_to_3066() {assert_no_lints("I’ve inspected the browser console for JavaScript errors, and there are none related to WooCommerce or the product variation functionality.",- ThereIsAgreement::new(FstDictionary::curated()),+ test_linter(),);}}diff --git a/harper-core/src/linting/thing_think.rs b/harper-core/src/linting/thing_think.rsindex 4694508b6..93dccf737 100644--- a/harper-core/src/linting/thing_think.rs+++ b/harper-core/src/linting/thing_think.rs@@ -101,15 +101,18 @@ impl ExprLinter for ThingThink {#[cfg(test)]mod tests {use super::ThingThink;+ use crate::linting::pooled_linter::for_tests::create_test_pool;use crate::linting::tests::assert_suggestion_result;+ create_test_pool!(ThingThink, ThingThink, ThingThink::default());+// Pronouns#[test]fn fix_you_thing() {assert_suggestion_result("Whad do you thing about tinygo?",- ThingThink::default(),+ test_linter(),"Whad do you think about tinygo?",);}@@ -118,7 +121,7 @@ mod tests {fn fix_i_thing() {assert_suggestion_result("bcz i thing hugging face embeddings and models are very complex",- ThingThink::default(),+ test_linter(),"bcz i think hugging face embeddings and models are very complex",);}@@ -127,7 +130,7 @@ mod tests {fn fix_we_thing() {assert_suggestion_result("which information we thing to be missing",- ThingThink::default(),+ test_linter(),"which information we think to be missing",);}@@ -136,7 +139,7 @@ mod tests {fn fix_they_thing() {assert_suggestion_result("they thing something is a good idea",- ThingThink::default(),+ test_linter(),"they think something is a good idea",);}@@ -145,7 +148,7 @@ mod tests {fn fix_everyone_thing() {assert_suggestion_result("What does everyone thing here?",- ThingThink::default(),+ test_linter(),"What does everyone think here?",);}@@ -154,7 +157,7 @@ mod tests {fn fix_anyone_thing() {assert_suggestion_result("Can anyone thing of a (reasonable) way to align them such that the 'a's in all 4 words will be in (more or less) the same vertical position?",- ThingThink::default(),+ test_linter(),"Can anyone think of a (reasonable) way to align them such that the 'a's in all 4 words will be in (more or less) the same vertical position?",);}@@ -163,7 +166,7 @@ mod tests {fn fix_anybody_thing() {assert_suggestion_result("If anybody thing there is an issue in Karma, please re-open.",- ThingThink::default(),+ test_linter(),"If anybody think there is an issue in Karma, please re-open.",);}@@ -172,7 +175,7 @@ mod tests {fn fix_every_body_thing() {assert_suggestion_result("What does every body thing I should do with my Randy Johnson rookie card.",- ThingThink::default(),+ test_linter(),"What does every body think I should do with my Randy Johnson rookie card.",);}@@ -183,7 +186,7 @@ mod tests {fn fix_have_to_thing() {assert_suggestion_result("I always have to thing what button does what action.",- ThingThink::default(),+ test_linter(),"I always have to think what button does what action.",);}@@ -192,7 +195,7 @@ mod tests {fn fix_need_to_thing() {assert_suggestion_result("No need to thing about the REGEX.",- ThingThink::default(),+ test_linter(),"No need to think about the REGEX.",);}@@ -201,7 +204,7 @@ mod tests {fn fix_want_to_thing() {assert_suggestion_result("maybe you want to thing of this also as a feature enhancement.",- ThingThink::default(),+ test_linter(),"maybe you want to think of this also as a feature enhancement.",);}@@ -210,7 +213,7 @@ mod tests {fn fix_having_to_thing() {assert_suggestion_result("it has saved me personally hours in combined time not having to thing about whether something is in seconds or milliseconds",- ThingThink::default(),+ test_linter(),"it has saved me personally hours in combined time not having to think about whether something is in seconds or milliseconds",);}@@ -219,7 +222,7 @@ mod tests {fn fix_needs_to() {assert_suggestion_result("When implementing any functionality once needs to thing aboiut how it is going to be used.",- ThingThink::default(),+ test_linter(),"When implementing any functionality once needs to think aboiut how it is going to be used.",);}@@ -228,7 +231,7 @@ mod tests {fn fix_needed_to() {assert_suggestion_result("Even in that case we needed to thing about the syntax so that we wouldn't need to change existing syntax",- ThingThink::default(),+ test_linter(),"Even in that case we needed to think about the syntax so that we wouldn't need to change existing syntax",);}@@ -237,7 +240,7 @@ mod tests {fn fix_had_to() {assert_suggestion_result("I had to thing in ways of making people more interested in it",- ThingThink::default(),+ test_linter(),"I had to think in ways of making people more interested in it",);}@@ -246,7 +249,7 @@ mod tests {fn fix_trying_to_thing() {assert_suggestion_result("Here I'm trying to thing about the following questions:",- ThingThink::default(),+ test_linter(),"Here I'm trying to think about the following questions:",);}@@ -257,7 +260,7 @@ mod tests {fn fix_can_thing() {assert_suggestion_result("The exe file dosen't work allways, because antivirus can thing it is a virus.",- ThingThink::default(),+ test_linter(),"The exe file dosen't work allways, because antivirus can think it is a virus.",);}@@ -266,7 +269,7 @@ mod tests {fn fix_could_thing() {assert_suggestion_result("\"doesNotReturnSameInstanceWhenCalledMultipleTimes\" is a terrible name, but the only one i could thing of immediately.",- ThingThink::default(),+ test_linter(),"\"doesNotReturnSameInstanceWhenCalledMultipleTimes\" is a terrible name, but the only one i could think of immediately.",);}@@ -275,7 +278,7 @@ mod tests {fn fix_might_thing() {assert_suggestion_result("Consider what a reader might thing when reading a switch",- ThingThink::default(),+ test_linter(),"Consider what a reader might think when reading a switch",);}@@ -284,7 +287,7 @@ mod tests {fn fix_should_thing() {assert_suggestion_result("And we should thing to add a flag so the user could decide if internal top level extension functions are ok or not.",- ThingThink::default(),+ test_linter(),"And we should think to add a flag so the user could decide if internal top level extension functions are ok or not.",);}@@ -293,7 +296,7 @@ mod tests {fn fix_may_thing() {assert_suggestion_result("It is easier than you may thing to run both bands with hostapd.",- ThingThink::default(),+ test_linter(),"It is easier than you may think to run both bands with hostapd.",);}@@ -302,7 +305,7 @@ mod tests {fn fix_cannot_thing() {assert_suggestion_result("I cannot thing of a simple way to implement compensation of a change in Fnco.",- ThingThink::default(),+ test_linter(),"I cannot think of a simple way to implement compensation of a change in Fnco.",);}@@ -311,7 +314,7 @@ mod tests {fn fix_will_thing() {assert_suggestion_result("So user will thing that delete operation is fine but its not this code deletes the wrong page and make one extra page which wrong.",- ThingThink::default(),+ test_linter(),"So user will think that delete operation is fine but its not this code deletes the wrong page and make one extra page which wrong.",);}@@ -320,7 +323,7 @@ mod tests {fn fix_cant_thing() {assert_suggestion_result("can't thing of another place, which could have such effect",- ThingThink::default(),+ test_linter(),"can't think of another place, which could have such effect",);}@@ -329,7 +332,7 @@ mod tests {fn fix_couldnt_thing() {assert_suggestion_result("I couldn't thing about a better title, but I run into problems since the new dplyr release.",- ThingThink::default(),+ test_linter(),"I couldn't think about a better title, but I run into problems since the new dplyr release.",);}@@ -338,7 +341,7 @@ mod tests {fn fix_shouldnt_thing() {assert_suggestion_result("When dealing with a multi-tenanted system, users shouldn't thing about 'Databases', they should think about Tenants.",- ThingThink::default(),+ test_linter(),"When dealing with a multi-tenanted system, users shouldn't think about 'Databases', they should think about Tenants.",);}@@ -347,7 +350,7 @@ mod tests {fn fix_wont_thing() {assert_suggestion_result("I think you need to use an io.Pipe so the Go HTTP Request won't thing the buf has been fulling read.",- ThingThink::default(),+ test_linter(),"I think you need to use an io.Pipe so the Go HTTP Request won't think the buf has been fulling read.",);}@@ -358,7 +361,7 @@ mod tests {fn fix_always_thing() {assert_suggestion_result("one should always thing of whether the efforts are better targeted to the improvement",- ThingThink::default(),+ test_linter(),"one should always think of whether the efforts are better targeted to the improvement",);}@@ -367,7 +370,7 @@ mod tests {fn fix_sometimes_thing() {assert_suggestion_result("One thing that I sometimes thing would be nice is if I could make different instances",- ThingThink::default(),+ test_linter(),"One thing that I sometimes think would be nice is if I could make different instances",);}@@ -376,7 +379,7 @@ mod tests {fn fix_often_thing() {assert_suggestion_result("When working with workflows on many forms I often thing I need to do the same over and over",- ThingThink::default(),+ test_linter(),"When working with workflows on many forms I often think I need to do the same over and over",);}@@ -385,7 +388,7 @@ mod tests {fn fix_never_thing() {assert_suggestion_result("just use UUIDv7 and never thing about those details again",- ThingThink::default(),+ test_linter(),"just use UUIDv7 and never think about those details again",);}@@ -394,7 +397,7 @@ mod tests {fn fix_usually_thing() {assert_suggestion_result("And the order of that relationship might be reversed from what one might usually thing.",- ThingThink::default(),+ test_linter(),"And the order of that relationship might be reversed from what one might usually think.",);}diff --git a/harper-core/src/linting/to_two_too/mod.rs b/harper-core/src/linting/to_two_too/mod.rsindex 6e63fe566..c321aac16 100644--- a/harper-core/src/linting/to_two_too/mod.rs+++ b/harper-core/src/linting/to_two_too/mod.rs@@ -36,6 +36,9 @@ merge_linters!(#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(ToTwoToo, ToTwoToo, ToTwoToo::default());use crate::linting::tests::{assert_lint_count, assert_no_lints, assert_suggestion_result};use super::ToTwoToo;@@ -44,7 +47,7 @@ mod tests {fn fixes_to_ambitious() {assert_suggestion_result("The project scope is to ambitious",- ToTwoToo::default(),+ test_linter(),"The project scope is too ambitious",);}@@ -53,58 +56,55 @@ mod tests {fn fixes_end_of_sent() {assert_suggestion_result("She wants ice cream, to.",- ToTwoToo::default(),+ test_linter(),"She wants ice cream, too.",);}#[test]fn flags_to_hungry() {- assert_lint_count("I am to hungry.", ToTwoToo::default(), 1);+ assert_lint_count("I am to hungry.", test_linter(), 1);}#[test]fn no_lint_on_proper_too() {- assert_no_lints("I am too hungry.", ToTwoToo::default());+ assert_no_lints("I am too hungry.", test_linter());}#[test]fn flags_to_with_irregular_whitespace() {- assert_lint_count("She was to\t tired.", ToTwoToo::default(), 1);- assert_lint_count("He felt it was\nto cold.", ToTwoToo::default(), 1);+ assert_lint_count("She was to\t tired.", test_linter(), 1);+ assert_lint_count("He felt it was\nto cold.", test_linter(), 1);}#[test]fn flags_to_with_trailing_punct() {- assert_lint_count("He spoke to loud!", ToTwoToo::default(), 1);- assert_lint_count("He spoke to loud?", ToTwoToo::default(), 1);- assert_lint_count("He spoke to loud.", ToTwoToo::default(), 1);+ assert_lint_count("He spoke to loud!", test_linter(), 1);+ assert_lint_count("He spoke to loud?", test_linter(), 1);+ assert_lint_count("He spoke to loud.", test_linter(), 1);}#[test]fn no_lint_to_eat() {- assert_no_lints(- "Please remember to eat your vegetables.",- ToTwoToo::default(),- );+ assert_no_lints("Please remember to eat your vegetables.", test_linter());}#[test]fn no_lint_to_nashville_or_you() {- assert_no_lints("I’m going to Nashville next week.", ToTwoToo::default());- assert_no_lints("Talk to you later.", ToTwoToo::default());+ assert_no_lints("I’m going to Nashville next week.", test_linter());+ assert_no_lints("Talk to you later.", test_linter());}#[test]fn no_lint_distance_from_center() {- assert_no_lints("Distance from the center to any face", ToTwoToo::default());+ assert_no_lints("Distance from the center to any face", test_linter());}#[test]fn fixes_too_go() {assert_suggestion_result("I want too go abroad.",- ToTwoToo::default(),+ test_linter(),"I want to go abroad.",);}@@ -113,7 +113,7 @@ mod tests {fn fixes_too_him() {assert_suggestion_result("Give it too him as a gift",- ToTwoToo::default(),+ test_linter(),"Give it to him as a gift",);}@@ -122,7 +122,7 @@ mod tests {fn fixes_too_the() {assert_suggestion_result("We're going too the conference.",- ToTwoToo::default(),+ test_linter(),"We're going to the conference.",);}@@ -131,7 +131,7 @@ mod tests {fn fixes_too_a() {assert_suggestion_result("We're going too a concert.",- ToTwoToo::default(),+ test_linter(),"We're going to a concert.",);}@@ -140,47 +140,44 @@ mod tests {fn fixes_to_hard() {assert_suggestion_result("It's not to hard, is it?",- ToTwoToo::default(),+ test_linter(),"It's not too hard, is it?",);}#[test]fn no_lint_too_hot() {- assert_no_lints("The coffee is too hot to drink.", ToTwoToo::default());+ assert_no_lints("The coffee is too hot to drink.", test_linter());}#[test]fn no_lint_too_loud() {assert_no_lints("The music was too loud, making it hard to hear.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn no_lint_too_shy() {- assert_no_lints("He's too shy to speak in public.", ToTwoToo::default());+ assert_no_lints("He's too shy to speak in public.", test_linter());}#[test]fn no_lint_too_sweet() {- assert_no_lints("The cake is too sweet for my taste.", ToTwoToo::default());+ assert_no_lints("The cake is too sweet for my taste.", test_linter());}#[test]fn no_lint_too_expensive() {- assert_no_lints(- "It's too expensive for me to buy right now.",- ToTwoToo::default(),- );+ assert_no_lints("It's too expensive for me to buy right now.", test_linter());}#[test]fn no_lint_too_hard() {assert_no_lints("She worked too hard and ended up getting sick.",- ToTwoToo::default(),+ test_linter(),);}@@ -188,39 +185,30 @@ mod tests {fn no_lint_too_complicated() {assert_no_lints("The instructions were too complicated to understand.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn no_lint_too_too() {- assert_no_lints(- "I like apples, and my brother does too.",- ToTwoToo::default(),- );+ assert_no_lints("I like apples, and my brother does too.", test_linter());}#[test]fn no_lint_too_too_2() {- assert_no_lints(- "She's coming to the party, and he is too.",- ToTwoToo::default(),- );+ assert_no_lints("She's coming to the party, and he is too.", test_linter());}#[test]fn no_lint_too_too_3() {- assert_no_lints(- "I want to go to the beach, and you do too?",- ToTwoToo::default(),- );+ assert_no_lints("I want to go to the beach, and you do too?", test_linter());}#[test]fn no_lint_too_too_4() {assert_no_lints("He's a talented musician, and a great friend too.",- ToTwoToo::default(),+ test_linter(),);}@@ -228,7 +216,7 @@ mod tests {fn no_lint_too_too_5() {assert_no_lints("The movie was good, and the popcorn was delicious too.",- ToTwoToo::default(),+ test_linter(),);}@@ -236,7 +224,7 @@ mod tests {fn no_lint_too_difficult_too_close() {assert_no_lints("The problem is too difficult, and the deadline is too close.",- ToTwoToo::default(),+ test_linter(),);}@@ -244,7 +232,7 @@ mod tests {fn no_lint_too_good_too_nice() {assert_no_lints("He's too good at the game, and he's too nice to win.",- ToTwoToo::default(),+ test_linter(),);}@@ -252,20 +240,20 @@ mod tests {fn allow_young_musicians() {assert_no_lints("Bringing Hope and Opportunity to Young Musicians",- ToTwoToo::default(),+ test_linter(),);}#[test]fn allow_semicolon() {- assert_no_lints("Attendees can look forward to:", ToTwoToo::default());+ assert_no_lints("Attendees can look forward to:", test_linter());}#[test]fn allow_build_brighter() {assert_no_lints("We're empowering them to build brighter futures.",- ToTwoToo::default(),+ test_linter(),);}@@ -273,7 +261,7 @@ mod tests {fn allow_delegate() {assert_no_lints("I’d like you to consciously delegate one task",- ToTwoToo::default(),+ test_linter(),);}@@ -281,7 +269,7 @@ mod tests {fn no_lint_soundscapes() {assert_no_lints("Soundscapes are not merely environmental features; they are integral to human identity and cultural expression.",- ToTwoToo::default(),+ test_linter(),);}@@ -289,7 +277,7 @@ mod tests {fn no_lint_speed_flexibility() {assert_no_lints("Its speed, flexibility, and seamless integration with FZF make it a compelling alternative to traditional fuzzy finding solutions.",- ToTwoToo::default(),+ test_linter(),);}@@ -297,7 +285,7 @@ mod tests {fn no_lint_explicitly_cast() {assert_no_lints("Attempted to explicitly cast the result back to a string",- ToTwoToo::default(),+ test_linter(),);}@@ -305,7 +293,7 @@ mod tests {fn no_lint_buried_under_data() {assert_no_lints("They felt buried under the data, unable to proactively address emerging threats.",- ToTwoToo::default(),+ test_linter(),);}@@ -313,7 +301,7 @@ mod tests {fn no_lint_familiarize() {assert_no_lints("Familiarize yourself with these resources to learn how to effectively utilize the plugin’s features.",- ToTwoToo::default(),+ test_linter(),);}@@ -321,7 +309,7 @@ mod tests {fn no_lint_great_deal_of_energy() {assert_no_lints("It takes a great deal of energy to consistently operate under that kind of pressure.",- ToTwoToo::default(),+ test_linter(),);}@@ -329,20 +317,20 @@ mod tests {fn no_lint_occasionally_troubleshoot() {assert_no_lints("Just be prepared to occasionally troubleshoot the debugger itself.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn ccoveille_suggestion() {- assert_no_lints("He goes too far with bets.", ToTwoToo::default());+ assert_no_lints("He goes too far with bets.", test_linter());}#[test]fn no_lint_auto_detect_debuggers() {assert_no_lints("Daprio attempts to auto-detect debugger servers and configurations, which can save significant time, especially for common languages.",- ToTwoToo::default(),+ test_linter(),);}@@ -350,7 +338,7 @@ mod tests {fn no_lint_commitment_open_source() {assert_no_lints("I believe a commitment to open-source solutions and internal skill development would ultimately yield a more sustainable and ethical approach.",- ToTwoToo::default(),+ test_linter(),);}@@ -358,7 +346,7 @@ mod tests {fn no_lint_feeling_confident_dominate() {assert_no_lints("I'm feeling confident, and I suspect you all should be too – because I’m about to dominate.",- ToTwoToo::default(),+ test_linter(),);}@@ -366,7 +354,7 @@ mod tests {fn no_lint_egyptian_smiling_faces_commentary() {assert_no_lints("Today I learned that the ubiquitous, seemingly cheerful faces carved into ancient Egyptian relief sculptures – often referred to as “smiling faces” – weren’t simply a stylistic choice reflecting happiness. Recent scholarship suggests they functioned as a subtle, often satirical, form of social commentary, particularly targeting individuals who were arrogant, boastful, or otherwise deserving of ridicule.",- ToTwoToo::default(),+ test_linter(),);}@@ -374,44 +362,38 @@ mod tests {fn no_lint_intended_to_leave_it_to() {assert_no_lints("Beatrice never explicitly said who she intended to leave it to.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn no_lint_time_for_good_girl_to_bed() {- assert_no_lints("Time for this good girl to go to bed.", ToTwoToo::default());+ assert_no_lints("Time for this good girl to go to bed.", test_linter());}#[test]fn no_lint_connected_to_many_other_fields() {assert_no_lints("The study is connected to many other fields.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn no_lint_till_she_too_began_dreaming() {- assert_no_lints(- "till she too began dreaming after a fashion",- ToTwoToo::default(),- );+ assert_no_lints("till she too began dreaming after a fashion", test_linter());}#[test]fn no_lint_to_quickly_find_a_factory() {- assert_no_lints(- "To quickly find a factory, look for a map.",- ToTwoToo::default(),- );+ assert_no_lints("To quickly find a factory, look for a map.", test_linter());}#[test]fn no_lint_asking_to_simply_in_scare_quotes() {assert_no_lints("He was asking to simply \"show up\" for the meeting.",- ToTwoToo::default(),+ test_linter(),);}@@ -419,7 +401,7 @@ mod tests {fn no_lint_llm_as_judge_to_automatically_score() {assert_no_lints("We used an LLM-as-judge to automatically score agent trajectories.",- ToTwoToo::default(),+ test_linter(),);}@@ -427,7 +409,7 @@ mod tests {fn no_lint_all_the_way_to_advanced_usage() {assert_no_lints("All the way to advanced usage, like an expert.",- ToTwoToo::default(),+ test_linter(),);}@@ -435,45 +417,45 @@ mod tests {fn no_lint_access_to_over_400_integrations() {assert_no_lints("You'll have access to over 400 integrations.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn no_lint_accustomed_to_precision() {- assert_no_lints("I’m rather accustomed to precision.", ToTwoToo::default());+ assert_no_lints("I’m rather accustomed to precision.", test_linter());}#[test]fn no_lint_prone_to_melancholy() {- assert_no_lints("He wasn’t a man prone to melancholy.", ToTwoToo::default());+ assert_no_lints("He wasn’t a man prone to melancholy.", test_linter());}#[test]fn no_lint_superlative_range() {- assert_no_lints("Sort speeds from slowest to fastest.", ToTwoToo::default());+ assert_no_lints("Sort speeds from slowest to fastest.", test_linter());}#[test]fn no_lint_comparative_range() {- assert_no_lints("We rank tasks from harder to easier.", ToTwoToo::default());+ assert_no_lints("We rank tasks from harder to easier.", test_linter());}#[test]fn still_lints_positive_adjective_end() {- assert_lint_count("The room felt to cold.", ToTwoToo::default(), 1);+ assert_lint_count("The room felt to cold.", test_linter(), 1);}#[test]fn no_lint_to_only() {assert_no_lints("The dog was restricted to only one can of food.",- ToTwoToo::default(),+ test_linter(),);}#[test]fn no_lint_to_only_at_end() {- assert_no_lints("limited to only", ToTwoToo::default());+ assert_no_lints("limited to only", test_linter());}}diff --git a/harper-core/src/linting/web_scraping.rs b/harper-core/src/linting/web_scraping.rsindex 9d9aec795..835799e48 100644--- a/harper-core/src/linting/web_scraping.rs+++ b/harper-core/src/linting/web_scraping.rs@@ -180,6 +180,9 @@ impl ExprLinter for WebScraping {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(WebScraping, WebScraping, WebScraping::default());use crate::linting::tests::assert_suggestion_result;use super::WebScraping;@@ -188,128 +191,128 @@ mod tests {#[test]fn scrap() {- assert_suggestion_result("webscrap", WebScraping::default(), "webscrape");+ assert_suggestion_result("webscrap", test_linter(), "webscrape");}#[test]fn scraps() {- assert_suggestion_result("webscraps", WebScraping::default(), "webscrapes");+ assert_suggestion_result("webscraps", test_linter(), "webscrapes");}#[test]fn scrapped() {- assert_suggestion_result("webscrapped", WebScraping::default(), "webscraped");+ assert_suggestion_result("webscrapped", test_linter(), "webscraped");}#[test]fn scrapper() {- assert_suggestion_result("webscrapper", WebScraping::default(), "webscraper");+ assert_suggestion_result("webscrapper", test_linter(), "webscraper");}#[test]fn scrappers() {- assert_suggestion_result("webscrappers", WebScraping::default(), "webscrapers");+ assert_suggestion_result("webscrappers", test_linter(), "webscrapers");}#[test]fn scrapping() {- assert_suggestion_result("webscrapping", WebScraping::default(), "webscraping");+ assert_suggestion_result("webscrapping", test_linter(), "webscraping");}// Basic open compound tests#[test]fn scrap_open() {- assert_suggestion_result("web scrap", WebScraping::default(), "web scrape");+ assert_suggestion_result("web scrap", test_linter(), "web scrape");}#[test]fn scraps_open() {- assert_suggestion_result("web scraps", WebScraping::default(), "web scrapes");+ assert_suggestion_result("web scraps", test_linter(), "web scrapes");}#[test]fn scrapped_open() {- assert_suggestion_result("web scrapped", WebScraping::default(), "web scraped");+ assert_suggestion_result("web scrapped", test_linter(), "web scraped");}#[test]fn scrapper_open() {- assert_suggestion_result("web scrapper", WebScraping::default(), "web scraper");+ assert_suggestion_result("web scrapper", test_linter(), "web scraper");}#[test]fn scrappers_open() {- assert_suggestion_result("web scrappers", WebScraping::default(), "web scrapers");+ assert_suggestion_result("web scrappers", test_linter(), "web scrapers");}#[test]fn scrapping_open() {- assert_suggestion_result("web scrapping", WebScraping::default(), "web scraping");+ assert_suggestion_result("web scrapping", test_linter(), "web scraping");}// Basic hyphenated compound tests#[test]fn scrap_hyphenated() {- assert_suggestion_result("web-scrap", WebScraping::default(), "web-scrape");+ assert_suggestion_result("web-scrap", test_linter(), "web-scrape");}#[test]fn scraps_hyphenated() {- assert_suggestion_result("web-scraps", WebScraping::default(), "web-scrapes");+ assert_suggestion_result("web-scraps", test_linter(), "web-scrapes");}#[test]fn scrapped_hyphenated() {- assert_suggestion_result("web-scrapped", WebScraping::default(), "web-scraped");+ assert_suggestion_result("web-scrapped", test_linter(), "web-scraped");}#[test]fn scrapper_hyphenated() {- assert_suggestion_result("web-scrapper", WebScraping::default(), "web-scraper");+ assert_suggestion_result("web-scrapper", test_linter(), "web-scraper");}#[test]fn scrappers_hyphenated() {- assert_suggestion_result("web-scrappers", WebScraping::default(), "web-scrapers");+ assert_suggestion_result("web-scrappers", test_linter(), "web-scrapers");}#[test]fn scrapping_hyphenated() {- assert_suggestion_result("web-scrapping", WebScraping::default(), "web-scraping");+ assert_suggestion_result("web-scrapping", test_linter(), "web-scraping");}// Verb+object basic functionality tests#[test]fn scrap_page() {- assert_suggestion_result("scrap page", WebScraping::default(), "scrape page");+ assert_suggestion_result("scrap page", test_linter(), "scrape page");}#[test]fn scrapped_pages() {- assert_suggestion_result("scrapped pages", WebScraping::default(), "scraped pages");+ assert_suggestion_result("scrapped pages", test_linter(), "scraped pages");}#[test]fn scraps_html() {- assert_suggestion_result("scraps html", WebScraping::default(), "scrapes html");+ assert_suggestion_result("scraps html", test_linter(), "scrapes html");}#[test]fn scrapping_web() {- assert_suggestion_result("scrapping web", WebScraping::default(), "scraping web");+ assert_suggestion_result("scrapping web", test_linter(), "scraping web");}#[test]fn scrapping_web_all_caps() {- assert_suggestion_result("SCRAPPING WEB", WebScraping::default(), "SCRAPING WEB");+ assert_suggestion_result("SCRAPPING WEB", test_linter(), "SCRAPING WEB");}#[test]fn scrapping_web_mixed_case() {- assert_suggestion_result("Scrapping Web", WebScraping::default(), "Scraping Web");+ assert_suggestion_result("Scrapping Web", test_linter(), "Scraping Web");}// Real-world examples harvested from GitHub@@ -318,7 +321,7 @@ mod tests {fn web_scrap_lowercase() {assert_suggestion_result("The goal of the project is to web scrap data from all pages of the website with capability of handling exceptions.",- WebScraping::default(),+ test_linter(),"The goal of the project is to web scrape data from all pages of the website with capability of handling exceptions.",);}@@ -327,7 +330,7 @@ mod tests {fn web_scrap_open_both_words_titlecase() {assert_suggestion_result("Web Scrap on Jabama website to generate and analyze a dataset",- WebScraping::default(),+ test_linter(),"Web Scrape on Jabama website to generate and analyze a dataset",);}@@ -336,7 +339,7 @@ mod tests {fn web_scrapped_open_first_word_titlecase() {assert_suggestion_result("Web scrapped an amazon page , automated the scraping, stored the data in csv file and created an email alert when the drop prices",- WebScraping::default(),+ test_linter(),"Web scraped an amazon page , automated the scraping, stored the data in csv file and created an email alert when the drop prices",);}@@ -345,7 +348,7 @@ mod tests {fn web_scrapped_open_both_words_titlecase() {assert_suggestion_result("This project uses the data collected (Web Scrapped) from a website that list the houses for sale in Rwanda",- WebScraping::default(),+ test_linter(),"This project uses the data collected (Web Scraped) from a website that list the houses for sale in Rwanda",);}@@ -354,7 +357,7 @@ mod tests {fn web_scrapped_hyphenated_both_words_titlecase() {assert_suggestion_result("Web-Scrapped Datasets",- WebScraping::default(),+ test_linter(),"Web-Scraped Datasets",);}@@ -363,7 +366,7 @@ mod tests {fn web_scrapper_open_both_words_titlecase() {assert_suggestion_result("Web Scrapper Built Using Golang.",- WebScraping::default(),+ test_linter(),"Web Scraper Built Using Golang.",);}@@ -372,7 +375,7 @@ mod tests {fn web_scrappers_lowercase() {assert_suggestion_result("Internet bots and web scrappers that will save a lot of your time!",- WebScraping::default(),+ test_linter(),"Internet bots and web scrapers that will save a lot of your time!",);}@@ -381,7 +384,7 @@ mod tests {fn web_scrappers_hyphenated() {assert_suggestion_result("A Collection of web-scrappers with GUI written in Pyside6/PyQt6.",- WebScraping::default(),+ test_linter(),"A Collection of web-scrapers with GUI written in Pyside6/PyQt6.",);}@@ -390,7 +393,7 @@ mod tests {fn web_scrapping_lowercase() {assert_suggestion_result("ScrapPaper is a web scrapping method to extract journal information from PubMed and Google Scholar using Python script.",- WebScraping::default(),+ test_linter(),"ScrapPaper is a web scraping method to extract journal information from PubMed and Google Scholar using Python script.",);}@@ -399,7 +402,7 @@ mod tests {fn web_scrapping_titlecase() {assert_suggestion_result("Web Scrapping Examples using Beautiful Soup in Python.",- WebScraping::default(),+ test_linter(),"Web Scraping Examples using Beautiful Soup in Python.",);}@@ -408,7 +411,7 @@ mod tests {fn web_scrapping_hyphenated() {assert_suggestion_result("some websites allow web-scrapping some don't.",- WebScraping::default(),+ test_linter(),"some websites allow web-scraping some don't.",);}@@ -417,7 +420,7 @@ mod tests {fn webscrapped() {assert_suggestion_result("Example of webscrapped document : click here.",- WebScraping::default(),+ test_linter(),"Example of webscraped document : click here.",);}@@ -426,7 +429,7 @@ mod tests {fn webscrapper() {assert_suggestion_result("A webscrapper to scrape all the words and their meanings from urban dictionary.",- WebScraping::default(),+ test_linter(),"A webscraper to scrape all the words and their meanings from urban dictionary.",);}@@ -435,7 +438,7 @@ mod tests {fn webscrappers_capitalized() {assert_suggestion_result("A collection of Webscrappers I built using Scrapy while learning it hands on - SIdR4g/Scrapy_practice.",- WebScraping::default(),+ test_linter(),"A collection of Webscrapers I built using Scrapy while learning it hands on - SIdR4g/Scrapy_practice.",);}@@ -444,7 +447,7 @@ mod tests {fn webscrappers_camelcase() {assert_suggestion_result("Awesome-WebScrappers. Collection of powerful and efficient web scrapers built using Python and BeautifulSoup.",- WebScraping::default(),+ test_linter(),"Awesome-WebScrapers. Collection of powerful and efficient web scrapers built using Python and BeautifulSoup.",);}@@ -453,7 +456,7 @@ mod tests {fn webscrapping() {assert_suggestion_result("Webscrapping to identify and download latest pdf documents.",- WebScraping::default(),+ test_linter(),"Webscraping to identify and download latest pdf documents.",);}@@ -462,7 +465,7 @@ mod tests {fn webscraps_lowercase() {assert_suggestion_result("gostapafor is a tool that webscraps and forwards html pages to other consumers",- WebScraping::default(),+ test_linter(),"gostapafor is a tool that webscrapes and forwards html pages to other consumers",);}@@ -471,7 +474,7 @@ mod tests {fn webscraps_camelcase() {assert_suggestion_result("WebScraps the University of California, Santa Cruz's menu and texts it to the user for Breakfast, Lunch, Dinner, and Late Night.",- WebScraping::default(),+ test_linter(),"WebScrapes the University of California, Santa Cruz's menu and texts it to the user for Breakfast, Lunch, Dinner, and Late Night.",);}@@ -480,7 +483,7 @@ mod tests {fn scrap_html() {assert_suggestion_result("Scrap a website's HTML, CSS and JS using this API.",- WebScraping::default(),+ test_linter(),"Scrape a website's HTML, CSS and JS using this API.",);}@@ -489,7 +492,7 @@ mod tests {fn scrapped_news_articles() {assert_suggestion_result("Scrapped various news article including all the details using scrapy framework.",- WebScraping::default(),+ test_linter(),"Scrapped various news article including all the details using scrapy framework.",);}@@ -498,7 +501,7 @@ mod tests {fn scrapping_different_websites() {assert_suggestion_result("This repository contains Python scripts based on Scrapping different websites.",- WebScraping::default(),+ test_linter(),"This repository contains Python scripts based on Scraping different websites.",);}@@ -507,7 +510,7 @@ mod tests {fn scrapping_web_content() {assert_suggestion_result("Scrapping web content using PHP and Python.",- WebScraping::default(),+ test_linter(),"Scraping web content using PHP and Python.",);}@@ -516,7 +519,7 @@ mod tests {fn scraps_from_pages() {assert_suggestion_result("It requests the website and scraps news from different pages.",- WebScraping::default(),+ test_linter(),"It requests the website and scrapes news from different pages.",);}diff --git a/harper-core/src/linting/weir_rules/mod.rs b/harper-core/src/linting/weir_rules/mod.rsindex 338ae75ea..5eda7b8ce 100644--- a/harper-core/src/linting/weir_rules/mod.rs+++ b/harper-core/src/linting/weir_rules/mod.rs@@ -57,25 +57,37 @@ macro_rules! generate_boilerplate {#[cfg(test)]mod tests {+ use paste::paste;use crate::weir::tests::assert_passes_all;use crate::weir::WeirLinter;- #[test]- fn run_tests_for_weir_rules() {- $(- let mut linter = WeirLinter::new(- include_str!(concat!(env!("WEIR_RULE_DIR"), "/", $standalone_path)),- ).unwrap();- assert_passes_all(&mut linter);- )*+ $(+ paste! {+ #[test]+ fn [<run_tests_in_ $standalone_name:snake >](){+ let mut linter = WeirLinter::new(+ include_str!(concat!(env!("WEIR_RULE_DIR"), "/", $standalone_path)),+ ).unwrap();+ assert_passes_all(&mut linter);+ }+ }+ )*- $($(- let mut linter = WeirLinter::new(- include_str!(concat!(env!("WEIR_RULE_DIR"), "/", $child_path)),- ).unwrap();- assert_passes_all(&mut linter);- )*)*- }+ $(+ paste! {+ #[test]+ fn [<run_tests_in_ $group_name:snake >](){+ $(+ {+ let mut linter = WeirLinter::new(+ include_str!(concat!(env!("WEIR_RULE_DIR"), "/", $child_path)),+ ).unwrap();+ assert_passes_all(&mut linter);+ }+ )*+ }+ }+ )*}};}diff --git a/harper-core/src/linting/were_where.rs b/harper-core/src/linting/were_where.rsindex 4ca5f0799..34cd76b09 100644--- a/harper-core/src/linting/were_where.rs+++ b/harper-core/src/linting/were_where.rs@@ -124,6 +124,9 @@ impl ExprLinter for WereWhere {#[cfg(test)]mod tests {+ use crate::linting::pooled_linter::for_tests::create_test_pool;++ create_test_pool!(WereWhere, WereWhere, WereWhere::default());use super::WereWhere;use crate::linting::tests::{assert_no_lints, assert_suggestion_result};@@ -133,7 +136,7 @@ mod tests {fn fix_they_where() {assert_suggestion_result("They where going to the store.",- WereWhere::default(),+ test_linter(),"They were going to the store.",);}@@ -142,7 +145,7 @@ mod tests {fn fix_we_where() {assert_suggestion_result("We where right about that.",- WereWhere::default(),+ test_linter(),"We were right about that.",);}@@ -151,7 +154,7 @@ mod tests {fn fix_they_where_happy() {assert_suggestion_result("They where happy with the result.",- WereWhere::default(),+ test_linter(),"They were happy with the result.",);}@@ -162,7 +165,7 @@ mod tests {fn fix_you_where_going() {assert_suggestion_result("you where going in the right direction.",- WereWhere::default(),+ test_linter(),"you were going in the right direction.",);}@@ -171,7 +174,7 @@ mod tests {fn fix_you_where_right() {assert_suggestion_result("you where right about that.",- WereWhere::default(),+ test_linter(),"you were right about that.",);}@@ -182,7 +185,7 @@ mod tests {fn fix_know_were_they() {assert_suggestion_result("Do you know were they went?",- WereWhere::default(),+ test_linter(),"Do you know where they went?",);}@@ -191,7 +194,7 @@ mod tests {fn fix_forgot_were_i() {assert_suggestion_result("I forgot were I put my keys.",- WereWhere::default(),+ test_linter(),"I forgot where I put my keys.",);}@@ -200,7 +203,7 @@ mod tests {fn fix_found_were_the() {assert_suggestion_result("I found were the book was.",- WereWhere::default(),+ test_linter(),"I found where the book was.",);}@@ -209,7 +212,7 @@ mod tests {fn fix_go_were_they() {assert_suggestion_result("Go were they tell you.",- WereWhere::default(),+ test_linter(),"Go where they tell you.",);}@@ -221,7 +224,7 @@ mod tests {// No following-word check needed for "we/they" — the pair alone is enoughassert_suggestion_result("We where almost done with the task.",- WereWhere::default(),+ test_linter(),"We were almost done with the task.",);}@@ -230,7 +233,7 @@ mod tests {fn fix_they_where_able() {assert_suggestion_result("They where able to fix the issue in time.",- WereWhere::default(),+ test_linter(),"They were able to fix the issue in time.",);}@@ -239,7 +242,7 @@ mod tests {fn fix_we_where_told() {assert_suggestion_result("We where told about the change last week.",- WereWhere::default(),+ test_linter(),"We were told about the change last week.",);}@@ -248,7 +251,7 @@ mod tests {fn fix_they_where_supposed() {assert_suggestion_result("They where supposed to be here by now.",- WereWhere::default(),+ test_linter(),"They were supposed to be here by now.",);}@@ -260,7 +263,7 @@ mod tests {// "supposed" is ADJ — confirms verb slotassert_suggestion_result("You where supposed to call me.",- WereWhere::default(),+ test_linter(),"You were supposed to call me.",);}@@ -270,7 +273,7 @@ mod tests {// "asked" past participle used as VERBassert_suggestion_result("you where asked to leave the room.",- WereWhere::default(),+ test_linter(),"you were asked to leave the room.",);}@@ -279,7 +282,7 @@ mod tests {fn fix_where_you_able() {assert_suggestion_result("Where you able to make forward progress here?",- WereWhere::default(),+ test_linter(),"Were you able to make forward progress here?",);}@@ -290,7 +293,7 @@ mod tests {fn fix_remember_were_i() {assert_suggestion_result("Do you remember were I left the keys?",- WereWhere::default(),+ test_linter(),"Do you remember where I left the keys?",);}@@ -299,7 +302,7 @@ mod tests {fn fix_check_were_the() {assert_suggestion_result("Check were the error occurred.",- WereWhere::default(),+ test_linter(),"Check where the error occurred.",);}@@ -308,7 +311,7 @@ mod tests {fn fix_asked_were_he() {assert_suggestion_result("She asked were he lived.",- WereWhere::default(),+ test_linter(),"She asked where he lived.",);}@@ -317,7 +320,7 @@ mod tests {fn fix_know_were_the_bug() {assert_suggestion_result("I know were the bug is.",- WereWhere::default(),+ test_linter(),"I know where the bug is.",);}@@ -326,7 +329,7 @@ mod tests {fn fix_find_were_it() {assert_suggestion_result("Find were it crashed.",- WereWhere::default(),+ test_linter(),"Find where it crashed.",);}@@ -335,70 +338,70 @@ mod tests {#[test]fn no_flag_where_they_are() {- assert_no_lints("Do you know where they are going?", WereWhere::default());+ assert_no_lints("Do you know where they are going?", test_linter());}#[test]fn no_flag_they_were_going() {- assert_no_lints("They were going to the store.", WereWhere::default());+ assert_no_lints("They were going to the store.", test_linter());}#[test]fn no_flag_we_were_right() {- assert_no_lints("We were right about that.", WereWhere::default());+ assert_no_lints("We were right about that.", test_linter());}#[test]fn no_flag_show_you_where() {// "you" before "where" is legitimate — followed by "to" (PART), not a verb- assert_no_lints("I'll show you where to go.", WereWhere::default());+ assert_no_lints("I'll show you where to go.", test_linter());}#[test]fn no_flag_tell_you_where_the() {// "you where" followed by DET — not flagged (DET is not VERB/AUX/ADJ)- assert_no_lints("I'll tell you where the exit is.", WereWhere::default());+ assert_no_lints("I'll tell you where the exit is.", test_linter());}#[test]fn no_flag_they_were_wrong() {// "they" (PRON) precedes "were", so VERB + "were" pattern does not fire- assert_no_lints("I think they were wrong.", WereWhere::default());+ assert_no_lints("I think they were wrong.", test_linter());}#[test]fn no_flag_confirmed_they_were() {// "they" sits between "confirmed" and "were" — not adjacent, no match- assert_no_lints("I confirmed they were correct.", WereWhere::default());+ assert_no_lints("I confirmed they were correct.", test_linter());}#[test]fn no_flag_found_they_were() {- assert_no_lints("He found they were missing.", WereWhere::default());+ assert_no_lints("He found they were missing.", test_linter());}#[test]fn no_flag_where_were_they() {// "Where" is an adverb or subordinating conjunction here, not VERB — the were→where pattern does not fire- assert_no_lints("Where were they going?", WereWhere::default());+ assert_no_lints("Where were they going?", test_linter());}#[test]fn no_flag_showed_me_where() {// Object pronoun "me" sits between "showed" and "where" — no direct adjacency- assert_no_lints("He showed me where the exit was.", WereWhere::default());+ assert_no_lints("He showed me where the exit was.", test_linter());}#[test]fn no_flag_where_you_go() {- assert_no_lints("I wonder where you go from here.", WereWhere::default());+ assert_no_lints("I wonder where you go from here.", test_linter());}#[test]fn no_flag_where_you_can_customize() {assert_no_lints("Click the menu item where you can customize the settings.",- WereWhere::default(),+ test_linter(),);}@@ -406,7 +409,7 @@ mod tests {fn no_flag_where_you_allocate() {assert_no_lints("Use the panel where you allocate resources for the task.",- WereWhere::default(),+ test_linter(),);}@@ -417,7 +420,7 @@ mod tests {fn fix_you_where_the_only_one() {assert_suggestion_result("you where the only one there.",- WereWhere::default(),+ test_linter(),"you were the only one there.",);}@@ -427,7 +430,7 @@ mod tests {fn fix_where_they_going_sentence_start() {assert_suggestion_result("Where they going to the party?",- WereWhere::default(),+ test_linter(),"Were they going to the party?",);}@@ -437,7 +440,7 @@ mod tests {fn fix_showed_me_were() {assert_suggestion_result("He showed me were the exit was.",- WereWhere::default(),+ test_linter(),"He showed me where the exit was.",);}diff --git a/harper-core/tests/snapshot.rs b/harper-core/tests/snapshot.rsindex 447a179cf..13e1d7b21 100644--- a/harper-core/tests/snapshot.rs+++ b/harper-core/tests/snapshot.rs@@ -72,10 +72,12 @@ fn tag_file("No snapshot!".into()})}+fn get_snapshot_file(text_file: &Path, snapshot_dir: &Path, ext: &str) -> PathBuf {let snapshot_name = text_file.file_stem().unwrap().to_string_lossy().to_string() + ext;snapshot_dir.join(snapshot_name)}+#[allow(dead_code)]pub fn snapshot_all_text_files(out_dir: &str,diff --git a/harper-desktop/src-tauri/Cargo.toml b/harper-desktop/src-tauri/Cargo.tomlindex bf85d9ac7..8f66730b1 100644--- a/harper-desktop/src-tauri/Cargo.toml+++ b/harper-desktop/src-tauri/Cargo.toml@@ -34,7 +34,15 @@ dirs = "6.0.0"harper-core = { path = "../../harper-core" }harper-dictionary-wordlist = { path = "../../harper-dictionary-wordlist" }egui_commonmark = "0.23.0"-tokio = { version = "1.52.2", features = ["full"] }+tokio = { version = "1.52.1", default-features = false, features = [+ "io-std",+ "io-util",+ "macros",+ "process",+ "rt-multi-thread",+ "sync",+ "time",+] }tauri-plugin-os = "2.3.2"cached = "2.0.2"tracing = "0.1.44"diff --git a/harper-wasm/Cargo.toml b/harper-wasm/Cargo.tomlindex 3f80e2b9c..e2ab26809 100644--- a/harper-wasm/Cargo.toml+++ b/harper-wasm/Cargo.toml@@ -13,7 +13,7 @@ console_error_panic_hook = "0.1.7"tracing = "0.1.44"tracing-wasm = "0.2.1"wasm-bindgen = "0.2.97"-harper-core = { path = "../harper-core", version = "2.0.0", features = ["concurrent"], default-features = false }+harper-core = { path = "../harper-core", version = "2.0.0", features = [], default-features = false }harper-typst = { path = "../harper-typst", version = "2.0.0", optional = true }once_cell = "1.21.4"serde-wasm-bindgen = "0.6.5"