Skip to content

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

feat: layouted/layouting→laid out/laying out (#2669)

Andrew Dunbarf00c214d3c37
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index ca5d890eb..bd7fd90ad 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -290,6 +290,16 @@ pub fn lint_group() -> LintGroup {
"`Invest` is traditionally followed by 'in,' not `into.`",
LintKind::Usage
),
+ "LayoutVerb" => (
+ &[
+ ("layouted", "laid out"),
+ ("layouting", "laying out"),
+ // Note "layout" and "layouts" are valid as nouns
+ ],
+ "`layouted` and `layouting` are non-standard verb forms. Use `laid out` and `laying out` instead.",
+ "Flags nonstandard verb forms of `layout` (like `layouted` and `layouting`) and suggests the standard English verb forms (`laid out` and `laying out`).",
+ LintKind::Usage
+ ),
// General litotes (double negatives) → direct positive suggestions
"LitotesDirectPositive" => (
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index fe58ce0c9..2c3c0641e 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -199,49 +199,6 @@ fn corrects_dose_not() {
);
}
-// LitotesDirectPositive
-
-#[test]
-fn litotes_not_uncommon_atomic() {
- assert_suggestion_result("not uncommon", lint_group(), "common");
-}
-
-#[test]
-fn litotes_not_uncommon_sentence() {
- assert_suggestion_result(
- "It is not uncommon to see outages during storms.",
- lint_group(),
- "It is common to see outages during storms.",
- );
-}
-
-#[test]
-fn litotes_not_unlikely() {
- assert_suggestion_result(
- "This outcome is not unlikely given the data.",
- lint_group(),
- "This outcome is likely given the data.",
- );
-}
-
-#[test]
-fn litotes_not_insignificant() {
- assert_suggestion_result(
- "That is not insignificant progress.",
- lint_group(),
- "That is significant progress.",
- );
-}
-
-#[test]
-fn litotes_more_preferable() {
- assert_suggestion_result(
- "Is it more preferable to use process.env.variable or env.parsed.variable?",
- lint_group(),
- "Is it preferable to use process.env.variable or env.parsed.variable?",
- );
-}
-
// RedundantSuperlatives
#[test]
@@ -882,6 +839,69 @@ fn corrects_investment_into() {
);
}
+// LayoutVerb
+
+#[test]
+fn corrects_layouted() {
+ assert_suggestion_result(
+ "only the views that neeed it will be measured and layouted when the superview changes",
+ lint_group(),
+ "only the views that neeed it will be measured and laid out when the superview changes",
+ );
+}
+
+#[test]
+fn corrects_layouting() {
+ assert_suggestion_result(
+ "An R package for layouting tables, using the S4 method",
+ lint_group(),
+ "An R package for laying out tables, using the S4 method",
+ );
+}
+
+// LitotesDirectPositive
+
+#[test]
+fn litotes_not_uncommon_atomic() {
+ assert_suggestion_result("not uncommon", lint_group(), "common");
+}
+
+#[test]
+fn litotes_not_uncommon_sentence() {
+ assert_suggestion_result(
+ "It is not uncommon to see outages during storms.",
+ lint_group(),
+ "It is common to see outages during storms.",
+ );
+}
+
+#[test]
+fn litotes_not_unlikely() {
+ assert_suggestion_result(
+ "This outcome is not unlikely given the data.",
+ lint_group(),
+ "This outcome is likely given the data.",
+ );
+}
+
+#[test]
+fn litotes_not_insignificant() {
+ assert_suggestion_result(
+ "That is not insignificant progress.",
+ lint_group(),
+ "That is significant progress.",
+ );
+}
+
+#[test]
+fn litotes_more_preferable() {
+ assert_suggestion_result(
+ "Is it more preferable to use process.env.variable or env.parsed.variable?",
+ lint_group(),
+ "Is it preferable to use process.env.variable or env.parsed.variable?",
+ );
+}
+
// MakeDoWith
#[test]