Skip to content

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

feat: get used of→get used to (#2831)

Andrew Dunbaref8ce2113709
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index 290c2f7e3..4d1c3540b 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -243,6 +243,18 @@ pub fn lint_group() -> LintGroup {
"Corrects `flip the bill` to `foot the bill`.",
LintKind::Nonstandard
),
+ "GetUsedTo" => (
+ &[
+ ("get used of", "get used to"),
+ ("gets used of", "gets used to"),
+ ("getting used of", "getting used to"),
+ ("got used of", "got used to"),
+ ("gotten used of", "gotten used to"),
+ ],
+ "Use `used to` instead of `used of`.",
+ "Corrects `used of` to `used to`.",
+ LintKind::Usage
+ ),
"HavePassed" => (
&[
("had past", "had passed"),
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index 5e27e83d9..c4b2ba064 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -683,6 +683,58 @@ fn correct_flips_the_bill() {
);
}
+// GetUsedTo
+
+//-get used of-
+#[test]
+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(),
+ "I am following the examples in the documentation in order to get used to comets.",
+ );
+}
+
+//-gets used of-
+#[test]
+fn corrects_gets_used_of() {
+ assert_suggestion_result(
+ "its like she gets used of her food and becomes spoiled",
+ lint_group(),
+ "its like she gets used to her food and becomes spoiled",
+ );
+}
+
+//-getting used of-
+#[test]
+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(),
+ "Here you can find a guide to getting used to the most important methods of magum.",
+ );
+}
+
+//-got used of-
+#[test]
+fn corrects_got_used_of() {
+ assert_suggestion_result(
+ "we users actually got used of such delays",
+ lint_group(),
+ "we users actually got used to such delays",
+ );
+}
+
+//-gotten used of-
+#[test]
+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(),
+ "The tutorial has indeed been of help, and I've gotten used to using Hull.",
+ );
+}
+
// HavePassed
#[test]