Skip to content

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

fix(core): edge case found in Harper's documentation

Elijah Potterb25a9c5a2894
diff --git a/harper-core/src/linting/possessive_your.rs b/harper-core/src/linting/possessive_your.rs
index 06a2416f0..ed9326c1e 100644
--- a/harper-core/src/linting/possessive_your.rs
+++ b/harper-core/src/linting/possessive_your.rs
@@ -15,7 +15,7 @@ impl Default for PossessiveYour {
SequencePattern::aco("you")
.then_whitespace()
.then(|tok: &Token, _source: &[char]| {
- tok.kind.is_noun() && !tok.kind.is_verb() && !tok.kind.is_adverb()
+ tok.kind.is_noun() && !tok.kind.is_likely_homograph()
});
Self {
@@ -53,7 +53,7 @@ impl PatternLinter for PossessiveYour {
#[cfg(test)]
mod tests {
- use crate::linting::tests::assert_suggestion_result;
+ use crate::linting::tests::{assert_lint_count, assert_suggestion_result};
use super::PossessiveYour;
@@ -65,4 +65,13 @@ mod tests {
"Your comments may end up in the documentation.",
);
}
+
+ #[test]
+ fn allow_intro_page() {
+ assert_lint_count(
+ "You can try out an editor that uses Harper under-the-hood here.",
+ PossessiveYour::default(),
+ 0,
+ );
+ }
}