diff --git a/harper-core/src/linting/lets_confusion/mod.rs b/harper-core/src/linting/lets_confusion/mod.rs index d0e3f0fa..113b3b33 100644 --- a/harper-core/src/linting/lets_confusion/mod.rs +++ b/harper-core/src/linting/lets_confusion/mod.rs @@ -27,4 +27,14 @@ mod tests { fn from_harper_docs() { assert_suggestion_result("Often the longest and the shortest words are the most helpful, so lets push them first.", LetsConfusion::default(), "Often the longest and the shortest words are the most helpful, so let's push them first."); } + + #[test] + fn issue_470_missing_apostrophe() { + assert_suggestion_result("lets play", LetsConfusion::default(), "let's play"); + } + + #[test] + fn issue_470_missing_subject() { + assert_suggestion_result("let play", LetsConfusion::default(), "let's play"); + } } diff --git a/harper-core/src/linting/lets_confusion/no_contraction_with_verb.rs b/harper-core/src/linting/lets_confusion/no_contraction_with_verb.rs index 7d7925f8..a919aa70 100644 --- a/harper-core/src/linting/lets_confusion/no_contraction_with_verb.rs +++ b/harper-core/src/linting/lets_confusion/no_contraction_with_verb.rs @@ -1,6 +1,6 @@ use crate::{ linting::{Lint, LintKind, Suggestion}, - patterns::{Pattern, SequencePattern}, + patterns::{Pattern, SequencePattern, WordSet}, Token, }; @@ -12,7 +12,10 @@ pub struct NoContractionWithVerb { impl Default for NoContractionWithVerb { fn default() -> Self { - let pattern = SequencePattern::aco("lets").then_whitespace().then_verb(); + let pattern = SequencePattern::default() + .then_word_set(WordSet::all(&["lets", "let"])) + .then_whitespace() + .then_verb(); Self { pattern: Box::new(pattern),