Skip to content

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

feat: take control over→take control of (#4262)

Andrew Dunbar7bed83c748f2
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 4642c54c1..e7a1bdf11 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -5579,6 +5579,13 @@
"label": "Surreality"
}
},
+ {
+ "Bool": {
+ "name": "TakeControlOf",
+ "state": true,
+ "label": "Take Control of"
+ }
+ },
{
"Bool": {
"name": "TakeItPersonally",
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index ad49ec1f3..7a9349a8d 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -666,6 +666,18 @@ pub fn lint_group() -> LintGroup {
"Ensures proper use of the subjunctive mood in counterfactual conditional statements starting with `if only` or `I wish`.",
LintKind::Grammar
),
+ "TakeControlOf" => (
+ &[
+ ("take control over", "take control of"),
+ ("taken control over", "taken control of"),
+ ("takes control over", "takes control of"),
+ ("taking control over", "taking control of"),
+ ("took control over", "took control of"),
+ ],
+ "Use `take control of` instead of `take control over`.",
+ "Corrects `take control over` to `take control of`.",
+ LintKind::Usage
+ ),
"UseToUsedTo" => (
&[
// "be" verbs + "use to" -> "used to" (accustomed to)
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index 63b07c270..4112d2301 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -2157,6 +2157,53 @@ fn i_wish_it_was() {
);
}
+// TakeControlOf
+
+#[test]
+fn take() {
+ assert_suggestion_result(
+ "allowed .editorconfig to set editor ruler and take control over soft-wrap",
+ test_linter(),
+ "allowed .editorconfig to set editor ruler and take control of soft-wrap",
+ );
+}
+
+#[test]
+fn taken() {
+ assert_suggestion_result(
+ "I've taken control over the inputValue to be able to render the wanted menu items",
+ test_linter(),
+ "I've taken control of the inputValue to be able to render the wanted menu items",
+ );
+}
+
+#[test]
+fn takes() {
+ assert_suggestion_result(
+ "AI takes control over players hand",
+ test_linter(),
+ "AI takes control of players hand",
+ );
+}
+
+#[test]
+fn taking() {
+ assert_suggestion_result(
+ "this inconsistent behavior is very annoying for taking control over your dependency graph",
+ test_linter(),
+ "this inconsistent behavior is very annoying for taking control of your dependency graph",
+ );
+}
+
+#[test]
+fn took() {
+ assert_suggestion_result(
+ "Noted drone was NOT stoping and manually took control over it to stop it.",
+ test_linter(),
+ "Noted drone was NOT stoping and manually took control of it to stop it.",
+ );
+}
+
// UseToUsedTo
#[test]