Skip to content

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

chore: re-sort phrase corrections (#1410)

Andrew Dunbare246f2e289a4
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index 41e2eb978..1f0c825af 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -688,6 +688,18 @@ pub fn lint_group() -> LintGroup {
"Did you mean `I am`?",
"Fixes the incorrect spacing in `I a m` to properly form `I am`."
),
+ "IAmAgreement" => (
+ ["I are"],
+ ["I am"],
+ "The first-person singular pronoun `I` requires the verb form `am`; `are` belongs to second-person or plural contexts.",
+ "Corrects `I are` to `I am`."
+ ),
+ "IDo" => (
+ ["I does"],
+ ["I do"],
+ "`I` pairs with the bare verb `do`; the –s inflection `does` is reserved for third-person singular subjects.",
+ "Corrects `I does` to `I do`."
+ ),
"InAndOfItself" => (
["in of itself"],
["in and of itself"],
@@ -1317,18 +1329,6 @@ pub fn lint_group() -> LintGroup {
"Use `worst` for the extreme case. (`Worse` is for comparing)",
"Corrects `worse ever` to `worst ever` for proper comparative usage."
),
- "IAmAgreement" => (
- ["I are"],
- ["I am"],
- "The first-person singular pronoun `I` requires the verb form `am`; `are` belongs to second-person or plural contexts.",
- "Corrects `I are` to `I am`."
- ),
- "IDo" => (
- ["I does"],
- ["I do"],
- "`I` pairs with the bare verb `do`; the –s inflection `does` is reserved for third-person singular subjects.",
- "Corrects `I does` to `I do`."
- ),
});
group.set_all_rules_to(Some(true));
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
index d3a49cb1e..23e2c5d40 100644
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_corrections/tests.rs
@@ -931,6 +931,26 @@ fn hunger_pain() {
// IAm
// -none-
+// IAmAgreement
+#[test]
+fn corrects_i_are() {
+ assert_suggestion_result(
+ "I are really happy about this release.",
+ lint_group(),
+ "I am really happy about this release.",
+ );
+}
+
+// IDo
+#[test]
+fn corrects_i_does() {
+ assert_suggestion_result(
+ "I does enjoy writing Rust.",
+ lint_group(),
+ "I do enjoy writing Rust.",
+ );
+}
+
// InAndOfItself
#[test]
fn detect_atomic_in_of_itself() {
@@ -1918,21 +1938,3 @@ fn detect_worst_ever_real_world() {
fn now_on_hold() {
assert_lint_count("Those are now on hold for month.", lint_group(), 0);
}
-
-#[test]
-fn corrects_i_are() {
- assert_suggestion_result(
- "I are really happy about this release.",
- lint_group(),
- "I am really happy about this release.",
- );
-}
-
-#[test]
-fn corrects_i_does() {
- assert_suggestion_result(
- "I does enjoy writing Rust.",
- lint_group(),
- "I do enjoy writing Rust.",
- );
-}