Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: like as if→like / as if (#1592)

Andrew Dunbar9d3a2e42f41a
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index 0f896a56e..58a70288d 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -597,6 +597,12 @@ pub fn lint_group() -> LintGroup {
"Did you mean `let alone`?",
"Changes `let along` to `let alone`."
),
+ "LikeAsIf" => (
+ ["like as if"],
+ ["like", "as if"],
+ "Avoid redundancy. Use either `like` or `as if`.",
+ "Corrects redundant `like as if` to `like` or `as if`."
+ ),
"LikeThePlague" => (
["like a plague"],
["like the plague"],
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
index f80d88a5d..7fbfe78f0 100644
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_corrections/tests.rs
@@ -782,6 +782,16 @@ fn let_along() {
assert_suggestion_result("let along", lint_group(), "let alone");
}
+// LikeAsIf
+#[test]
+fn correct_like_as_if() {
+ assert_top3_suggestion_result(
+ "And looks like as if linux-personality hasn't got any changes for 8 years.",
+ lint_group(),
+ "And looks as if linux-personality hasn't got any changes for 8 years.",
+ );
+}
+
// LikeThePlague
#[test]
fn correct_like_a_plague() {