Skip to content

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

feat(core): rule for `EverPresent`

Elijah Potterbf42c93092cf
diff --git a/harper-core/src/linting/phrase_corrections.rs b/harper-core/src/linting/phrase_corrections.rs
index ac9ce22ad..e88611123 100644
--- a/harper-core/src/linting/phrase_corrections.rs
+++ b/harper-core/src/linting/phrase_corrections.rs
@@ -1213,6 +1213,12 @@ pub fn lint_group() -> LintGroup {
"The period of economic prosperity is called the `Gilded Age`.",
"If referring to the period of economic prosperity, the correct term is `Gilded Age`."
),
+ "EverPresent" => (
+ ["ever present"],
+ ["ever-present"],
+ "Hyphenate `ever-present` when it functions as a compound adjective.",
+ "Corrects the missing hyphen in `ever present` to the compound adjective `ever-present`."
+ ),
});
group.set_all_rules_to(Some(true));
@@ -2680,4 +2686,18 @@ mod tests {
"Every once in a while all the links on my page seem to stop working.",
);
}
+
+ #[test]
+ fn detect_ever_present_atomic() {
+ assert_suggestion_result("ever present", lint_group(), "ever-present");
+ }
+
+ #[test]
+ fn detect_ever_present_real_world() {
+ assert_suggestion_result(
+ "Distrust was an ever present tension in the negotiations.",
+ lint_group(),
+ "Distrust was an ever-present tension in the negotiations.",
+ );
+ }
}