Skip to content

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

feat: extend→extent when used as noun (#1552)

Andrew Dunbar5238f7c1a794
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index 1bbc001dc..9ad1febf5 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -117,6 +117,16 @@ pub fn lint_group() -> LintGroup {
"The correct names for the `!` punctuation are `exclamation mark` and `exclamation point`.",
"Corrects the eggcorn `explanation mark/point` to `exclamation mark/point`."
),
+ "ExtendOrExtent" => (
+ &[
+ ("a certain extend", "a certain extent"),
+ ("to an extend", "to an extent"),
+ ("to some extend", "to some extent"),
+ ("to the extend that", "to the extent that")
+ ],
+ "Use `extent` for the noun and `extend` for the verb.",
+ "Corrects `extend` to `extent` when the context is a noun."
+ ),
"HaveGone" => (
&[
("had went", "had gone"),
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index 20ed3a529..feef88e51 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -131,6 +131,44 @@ fn detect_explanation_point_real_world() {
);
}
+// ExtendOrExtent
+
+#[test]
+fn correct_certain_extend() {
+ assert_suggestion_result(
+ "This is a PowerShell script to automate client pentests / checkups - at least to a certain extend.",
+ lint_group(),
+ "This is a PowerShell script to automate client pentests / checkups - at least to a certain extent.",
+ );
+}
+
+#[test]
+fn correct_to_the_extend() {
+ assert_suggestion_result(
+ "Our artifacts are carefully documented and well-structured to the extend that reuse is facilitated.",
+ lint_group(),
+ "Our artifacts are carefully documented and well-structured to the extent that reuse is facilitated.",
+ );
+}
+
+#[test]
+fn correct_to_some_extend() {
+ assert_suggestion_result(
+ "Hi, I'm new to Pydantic and to some extend python, and I have a question that I haven't been able to figure out from the Docs.",
+ lint_group(),
+ "Hi, I'm new to Pydantic and to some extent python, and I have a question that I haven't been able to figure out from the Docs.",
+ );
+}
+
+#[test]
+fn correct_to_an_extend() {
+ assert_suggestion_result(
+ "It mimics (to an extend) the way in which Chrome requests SSO cookies with the Windows 10 accounts extension.",
+ lint_group(),
+ "It mimics (to an extent) the way in which Chrome requests SSO cookies with the Windows 10 accounts extension.",
+ );
+}
+
// HaveGone
#[test]