Skip to content

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

feat: also exempt "US" followed by subject pronoun

hippietrailba122eeda40c
diff --git a/harper-core/src/linting/multiple_sequential_pronouns.rs b/harper-core/src/linting/multiple_sequential_pronouns.rs
index 3e0f6e67d..1dd61da6a 100644
--- a/harper-core/src/linting/multiple_sequential_pronouns.rs
+++ b/harper-core/src/linting/multiple_sequential_pronouns.rs
@@ -99,6 +99,11 @@ impl PatternLinter for MultipleSequentialPronouns {
return None;
}
+ // The same applies to uppercase before a subject pronoun
+ if first_word_raw == "US" && self.is_subject_pronoun(&second_word) {
+ return None;
+ }
+
suggestions.push(Suggestion::ReplaceWith(
matched_tokens[0].span.get_content(source).to_vec(),
));
@@ -208,4 +213,13 @@ mod tests {
0,
)
}
+
+ #[test]
+ fn dont_flag_subject_after_usa() {
+ assert_lint_count(
+ "And if it’s manufactured in the US it may have more automation.",
+ MultipleSequentialPronouns::new(),
+ 0,
+ )
+ }
}