Skip to content

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

feat: at/in the spur of the moment (#1447)

Andrew Dunbar5a88c17e928c
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index a51a7f641..4a15864d0 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -965,10 +965,10 @@ pub fn lint_group() -> LintGroup {
"Replaces the nonstandard `on second though` with the common idiom `on second thought` to indicate reconsideration."
),
"OnTheSpurOfTheMoment" => (
- ["on the spurt of the moment"],
+ ["on the spurt of the moment", "at the spur of the moment", "in the spur of the moment"],
["on the spur of the moment"],
"Use the correct phrase for acting spontaneously.",
- "Ensures the correct use of `on the spur of the moment`, avoiding confusion with the incorrect `spurt` variation."
+ "Ensures the correct use of `on the spur of the moment`, avoiding nonstandard variations."
),
"OperativeSystem" => (
["operative system"],
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
index 1cf01532f..a5a8e6cb5 100644
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_corrections/tests.rs
@@ -1457,7 +1457,29 @@ fn on_second_thought_no_false_positive() {
}
// OnTheSpurOfTheMoment
-// -none-
+fn fix_on_the_spurt_of_the_moment() {
+ assert_suggestion_result(
+ "Quite often in the spurt of the moment, someone will say something which they think is witty.",
+ lint_group(),
+ "Quite often on the spur of the moment, someone will say something which they think is witty.",
+ );
+}
+
+fn fix_at_the_spur_of_the_moment() {
+ assert_suggestion_result(
+ "but at the spur of the moment, I'd say that ansible-lint should work exactly like ansible",
+ lint_group(),
+ "but on the spur of the moment, I'd say that ansible-lint should work exactly like ansible",
+ );
+}
+
+fn fix_in_the_spur_of_the_moment() {
+ assert_suggestion_result(
+ "an assortment of things I started yesterday in the spur of the moment",
+ lint_group(),
+ "an assortment of things I started yesterday on the spur of the moment",
+ );
+}
// OperatingSystem
#[test]