Skip to content

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

feat: exempt "you guys" from the possessive your linter

hippietrail716698d0e4c7
diff --git a/harper-core/src/linting/possessive_your.rs b/harper-core/src/linting/possessive_your.rs
index 511c6c9c9..41f7ee9e4 100644
--- a/harper-core/src/linting/possessive_your.rs
+++ b/harper-core/src/linting/possessive_your.rs
@@ -14,8 +14,10 @@ impl Default for PossessiveYour {
let pattern =
SequencePattern::aco("you")
.then_whitespace()
- .then(|tok: &Token, _source: &[char]| {
- tok.kind.is_nominal() && !tok.kind.is_likely_homograph()
+ .then(|tok: &Token, source: &[char]| {
+ tok.kind.is_nominal()
+ && !tok.kind.is_likely_homograph()
+ && tok.span.get_content(source) != &['g', 'u', 'y', 's']
});
Self {
@@ -74,4 +76,13 @@ mod tests {
0,
);
}
+
+ #[test]
+ fn allow_you_guys() {
+ assert_lint_count(
+ "I mean I'm pretty sure you guys can't do anything with this stuff.",
+ PossessiveYour::default(),
+ 0,
+ );
+ }
}