Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat(core): make it clearer that two `that` tokens can always be condensed (#2193)
Elijah Potter029903cfd54f
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rsindex 1068f91d2..6038bf017 100644--- a/harper-core/src/linting/phrase_corrections/mod.rs+++ b/harper-core/src/linting/phrase_corrections/mod.rs@@ -1215,6 +1215,13 @@ pub fn lint_group() -> LintGroup {"Did you mean the definite article?","Fixes especially common misspellings of the word `the`",LintKind::Typo+ ),+ "RedundantThat" => (+ ["that that"],+ ["that"],+ "Consider whether the second `that` adds meaning in this context.",+ "There is rarely a situation where `that that` cannot be condensed into a single token.",+ LintKind::Repetition)});diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rsindex 6e7dc9e6d..ebe0cfb6a 100644--- a/harper-core/src/linting/phrase_corrections/tests.rs+++ b/harper-core/src/linting/phrase_corrections/tests.rs@@ -1949,3 +1949,12 @@ fn fixes_teh() {"I adore the light of the moon.",);}++#[test]+fn issue_2132() {+ assert_suggestion_result(+ "I know that that answer is correct",+ lint_group(),+ "I know that answer is correct",+ );+}diff --git a/harper-core/tests/text/linters/The Great Gatsby.snap.yml b/harper-core/tests/text/linters/The Great Gatsby.snap.ymlindex e4d66b40e..3fea64f21 100644--- a/harper-core/tests/text/linters/The Great Gatsby.snap.yml+++ b/harper-core/tests/text/linters/The Great Gatsby.snap.yml@@ -4746,6 +4746,17 @@ Message: |+Lint: Repetition (31 priority)+Message: |+ 3135 | uneasy anyhow until he had given them something, realizing in a vague way that+ | ^~~~~+ 3136 | that was all they came for. Mr. Sloane wanted nothing. A lemonade? No, thanks. A+ | ~~~~ Consider whether the second `that` adds meaning in this context.+Suggest:+ - Replace with: “that”+++Lint: Repetition (127 priority)Message: |3135 | uneasy anyhow until he had given them something, realizing in a vague way that