Skip to content

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

chore: adj-of-a false positives: light, multiple, red, top

hippietrail55b51ab2437a
diff --git a/harper-core/src/linting/adjective_of_a.rs b/harper-core/src/linting/adjective_of_a.rs
index db14a0fdb..6088515b6 100644
--- a/harper-core/src/linting/adjective_of_a.rs
+++ b/harper-core/src/linting/adjective_of_a.rs
@@ -35,18 +35,22 @@ const FALSE_POSITIVES: &[&str] = &[
"head",
"kind",
"left",
+ "light",
"meaning",
"middle",
+ "multiple",
"one",
"part",
"potential",
"precision",
+ "red",
// for "rid" I removed the `5` flag in `dictionary.dict``
"shadow",
"side",
"short",
"something",
"sound",
+ "top",
];
fn is_false_positive(chars: &[char]) -> bool {
@@ -519,4 +523,28 @@ mod tests {
0,
);
}
+
+ #[test]
+ fn dont_flag_light() {
+ assert_lint_count("The light of a star.", AdjectiveOfA, 0);
+ }
+
+ #[test]
+ fn dont_flag_multiple() {
+ assert_lint_count(
+ "The image needs to be a multiple of a certain size.",
+ AdjectiveOfA,
+ 0,
+ );
+ }
+
+ #[test]
+ fn dont_flag_red() {
+ assert_lint_count("The red of a drop of blood.", AdjectiveOfA, 0);
+ }
+
+ #[test]
+ fn dont_flag_top() {
+ assert_lint_count("The top of a hill.", AdjectiveOfA, 0);
+ }
}