Skip to content

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

feat: passerbys→passersby (#2135)

Andrew Dunbar387f5e27466d
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index fee816601..cf2791294 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -864,7 +864,7 @@ pub fn lint_group() -> LintGroup {
["points of view"],
"The correct plural is `points of view`.",
"Corrects pluralizing the wrong noun in `point of view`.",
- LintKind::Usage
+ LintKind::Grammar
),
"PortAuPrince" => (
// Note: this lint matches any case but cannot correct wrong case
@@ -943,7 +943,7 @@ pub fn lint_group() -> LintGroup {
["rules of thumb"],
"The correct plural is `rules of thumb`.",
"Corrects pluralizing the wrong noun in `rule of thumb`.",
- LintKind::Usage
+ LintKind::Grammar
),
"SameAs" => (
["same then"],
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index 428dbbd6e..5f112f3a1 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -280,6 +280,15 @@ pub fn lint_group() -> LintGroup {
"Ensures `operating system` is used correctly instead of `operative system`.",
LintKind::Usage
),
+ "PassersBy" => (
+ &[
+ ("passerbys", "passersby"),
+ ("passer-bys", "passers-by"),
+ ],
+ "The correct plural is `passersby` or `passers-by`.",
+ "Corrects `passerbys` and `passer-bys` to `passersby` or `passers-by`.",
+ LintKind::Grammar
+ ),
"Piggyback" => (
&[
("piggy bag", "piggyback"),
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index cd2ee2787..24f6d02fa 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -809,6 +809,25 @@ fn operative_systems() {
);
}
+// PassersBy
+#[test]
+fn correct_passerbys() {
+ assert_suggestion_result(
+ "For any passerbys, you may replace visibility: hidden/collapsed with: opacity: 0; pointer-events: none;.",
+ lint_group(),
+ "For any passersby, you may replace visibility: hidden/collapsed with: opacity: 0; pointer-events: none;.",
+ );
+}
+
+#[test]
+fn correct_passer_bys_hyphen() {
+ assert_suggestion_result(
+ "Is there any way for random willing passer-bys to help with this effort?",
+ lint_group(),
+ "Is there any way for random willing passers-by to help with this effort?",
+ );
+}
+
// Piggyback
// -none-