Skip to content

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

fix: don't flag "each of whom" (#3078)

Andrew Dunbar8b86d9ff1124
diff --git a/harper-core/src/linting/whom_subject_of_verb.rs b/harper-core/src/linting/whom_subject_of_verb.rs
index fc2bfc15f..15da1b6ae 100644
--- a/harper-core/src/linting/whom_subject_of_verb.rs
+++ b/harper-core/src/linting/whom_subject_of_verb.rs
@@ -47,7 +47,9 @@ impl ExprLinter for WhomSubjectOfVerb {
&& ws2.kind.is_whitespace()
&& prep.get_ch(src).eq_ch(&['o', 'f'])
&& ws1.kind.is_whitespace()
- && word.get_ch(src).eq_str("many")
+ && word
+ .get_ch(src)
+ .eq_any_ignore_ascii_case_str(&["each", "many"])
{
return None;
}
@@ -145,4 +147,12 @@ mod tests {
WhomSubjectOfVerb::default(),
);
}
+
+ #[test]
+ fn dont_flag_each_of_whom() {
+ assert_no_lints(
+ "Horace Silver (piano), Tyrone Washington (tenor sax), and Roger Humphries (drums), each of whom has a wikipedia article about him.",
+ WhomSubjectOfVerb::default(),
+ )
+ }
}