Skip to content

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

fix(core): stop `LetsConfusion` flagging quantifiers after `let's` (#4082)

Mauro Pereiraed8c7ff47a48
diff --git a/harper-core/src/linting/lets_confusion/let_us_redundancy.rs b/harper-core/src/linting/lets_confusion/let_us_redundancy.rs
index 7b65f1638..1ac5850cb 100644
--- a/harper-core/src/linting/lets_confusion/let_us_redundancy.rs
+++ b/harper-core/src/linting/lets_confusion/let_us_redundancy.rs
@@ -16,7 +16,9 @@ pub struct LetUsRedundancy {
impl Default for LetUsRedundancy {
fn default() -> Self {
- let pattern = SequenceExpr::aco("let's").then_whitespace().then_pronoun();
+ let pattern = SequenceExpr::aco("let's")
+ .then_whitespace()
+ .then_object_pronoun();
Self {
expr: Box::new(pattern),
diff --git a/harper-core/src/linting/lets_confusion/mod.rs b/harper-core/src/linting/lets_confusion/mod.rs
index 5b837894d..01a9e0611 100644
--- a/harper-core/src/linting/lets_confusion/mod.rs
+++ b/harper-core/src/linting/lets_confusion/mod.rs
@@ -76,4 +76,24 @@ mod tests {
0,
);
}
+
+ #[test]
+ fn issue_4037_all() {
+ assert_lint_count("Let's all go home.", LetsConfusion::default(), 0);
+ }
+
+ #[test]
+ fn issue_4037_both() {
+ assert_lint_count("Let's both try again.", LetsConfusion::default(), 0);
+ }
+
+ #[test]
+ fn issue_4037_everyone() {
+ assert_lint_count("Let's everyone take a seat.", LetsConfusion::default(), 0);
+ }
+
+ #[test]
+ fn issue_4037_everybody() {
+ assert_lint_count("Let's everybody take a seat.", LetsConfusion::default(), 0);
+ }
}