Skip to content

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

fix(core): restrict `GeneralCompoundNouns` to ignore adverb prefixes

Elijah Potter449552939bd4
diff --git a/harper-core/dictionary.dict b/harper-core/dictionary.dict
index d4aead245..e6bbddd23 100644
--- a/harper-core/dictionary.dict
+++ b/harper-core/dictionary.dict
@@ -12252,7 +12252,7 @@ anvil/14MS
anxiety/1SM
anxious/5YP
anxiousness/1M
-any/8~
+any/8~j5
anybody/8SM
anyhow/5
anymore/
diff --git a/harper-core/src/linting/compound_nouns/general_compound_nouns.rs b/harper-core/src/linting/compound_nouns/general_compound_nouns.rs
index f1c795d5a..5c2434c01 100644
--- a/harper-core/src/linting/compound_nouns/general_compound_nouns.rs
+++ b/harper-core/src/linting/compound_nouns/general_compound_nouns.rs
@@ -25,7 +25,7 @@ impl Default for GeneralCompoundNouns {
return false;
};
- tok.span.len() > 1 && !meta.article && !meta.preposition
+ tok.span.len() > 1 && !meta.article && !meta.preposition && !meta.is_adverb()
})
.then_whitespace()
.then(|tok: &Token, _: &[char]| {
diff --git a/harper-core/src/linting/compound_nouns/mod.rs b/harper-core/src/linting/compound_nouns/mod.rs
index 7f5d95410..68b0ba376 100644
--- a/harper-core/src/linting/compound_nouns/mod.rs
+++ b/harper-core/src/linting/compound_nouns/mod.rs
@@ -264,4 +264,13 @@ mod tests {
0,
);
}
+
+ #[test]
+ fn allows_issue_721() {
+ assert_lint_count(
+ "So if you adjust any one of these adjusters that can have a negative or a positive effect.",
+ CompoundNouns::default(),
+ 0,
+ );
+ }
}