Skip to content

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

feat: somebody's else / else's (#1448)

Andrew Dunbar5230a9d082fc
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index 7de40443e..a51a7f641 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -1100,6 +1100,12 @@ pub fn lint_group() -> LintGroup {
"Did you mean `sneaking suspicion`?",
"Changes `sneaky suspicion` to `sneaking suspicion`."
),
+ "SomebodyElses" => (
+ ["somebody's else", "somebody's else's"],
+ ["somebody else's"],
+ "This should be `somebody else's`?",
+ "Corrects `somebody else's` when the `'s` is in the wrong place."
+ ),
"SomeOfThe" => (
["some the"],
["some of the"],
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
index 21fbd80b0..1cf01532f 100644
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_corrections/tests.rs
@@ -1547,6 +1547,25 @@ fn sneaky_suspicion() {
assert_suggestion_result("sneaky suspicion", lint_group(), "sneaking suspicion");
}
+// SomebodyElses
+#[test]
+fn correct_somebodys_else() {
+ assert_suggestion_result(
+ "I really like your component and change to somebody's else would be really bad for now.",
+ lint_group(),
+ "I really like your component and change to somebody else's would be really bad for now.",
+ );
+}
+
+#[test]
+fn correct_somebodys_elses() {
+ assert_suggestion_result(
+ "Nice to know it's somebody's else's problem for a change.",
+ lint_group(),
+ "Nice to know it's somebody else's problem for a change.",
+ );
+}
+
// SomeOfThe
#[test]
fn corrects_some_the_beginning() {