Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat: conform that→confirm that (#1632)
Andrew Dunbar7c61ffcc6502
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rsindex f00916c04..230a38451 100644--- a/harper-core/src/linting/phrase_set_corrections/mod.rs+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs@@ -81,6 +81,19 @@ pub fn lint_group() -> LintGroup {"Corrects extraneous apostrophe in `client's side` and `server's side`.",LintKind::Punctuation),+ "ConfirmThat" => (+ &[+ ("conform that", "confirm that"),+ ("conformed that", "confirmed that"),+ ("conforms that", "confirms that"),+ // Note: false positives in this inflection:+ // "is there any example of a case that isn't fully conforming that is supported today?"+ ("conforming that", "confirming that"),+ ],+ "Did you mean `confirm` rather than `conform`?",+ "Corrects `conform` typos to `confirm`.",+ LintKind::Typo+ ),"DefiniteArticle" => (&[("definitive article", "definite article"),diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rsindex 3849cea73..a320774de 100644--- a/harper-core/src/linting/phrase_set_corrections/tests.rs+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs@@ -85,6 +85,54 @@ fn correct_servers_side() {);}+// ConfirmThat++#[test]+fn correct_conform_that() {+ assert_suggestion_result(+ "the WCAG requires every view of the page to conform that we move this",+ lint_group(),+ "the WCAG requires every view of the page to confirm that we move this",+ );+}++#[test]+fn corrects_conformed_that() {+ assert_suggestion_result(+ "I have conformed that works now.",+ lint_group(),+ "I have confirmed that works now.",+ );+}++#[test]+fn corrects_conforms_that() {+ assert_suggestion_result(+ "I conformed that with the correct configuration, this is working correctly.",+ lint_group(),+ "I confirmed that with the correct configuration, this is working correctly.",+ );+}++#[test]+#[ignore = "False positive not yet handled."]+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(),+ 0,+ );+}++#[test]+fn corrects_conforming_that() {+ assert_suggestion_result(+ "Thanks for conforming that this issue is fixed in the latest version.",+ lint_group(),+ "Thanks for confirming that this issue is fixed in the latest version.",+ );+}+// DefiniteArticle#[test]