Skip to content

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

feat: strike of genius/luck → stroke of genius/luck (#4217)

Andrew Dunbarb94a1d8d4d9b
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 9dce28fc6..e7d123878 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -2798,6 +2798,20 @@
"label": "Strike Chord"
}
},
+ {
+ "Bool": {
+ "name": "StrikeOfGenius",
+ "state": true,
+ "label": "Strike Of Genius"
+ }
+ },
+ {
+ "Bool": {
+ "name": "StrikeOfLuck",
+ "state": true,
+ "label": "Strike Of Luck"
+ }
+ },
{
"Bool": {
"name": "ThatThis",
diff --git a/harper-core/src/linting/weir_rules/StrikeOfGenius.weir b/harper-core/src/linting/weir_rules/StrikeOfGenius.weir
new file mode 100644
index 000000000..a3f20e393
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/StrikeOfGenius.weir
@@ -0,0 +1,9 @@
+expr main (strike of genius)
+
+let message "Did you mean `stroke of genius`?"
+let description "Detects incorrect usage of `strike of genius` and suggests `stroke of genius` as the correct phrase."
+let kind "Usage"
+let becomes "stroke of genius"
+
+test "After I had some incredible strike of genius (a.k.a. dumb luck), I got to see see something" "After I had some incredible stroke of genius (a.k.a. dumb luck), I got to see see something"
+test "What passes for mundane obviousness today was once a strike of genius nobody else saw coming." "What passes for mundane obviousness today was once a stroke of genius nobody else saw coming."
diff --git a/harper-core/src/linting/weir_rules/StrikeOfLuck.weir b/harper-core/src/linting/weir_rules/StrikeOfLuck.weir
new file mode 100644
index 000000000..e681596f5
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/StrikeOfLuck.weir
@@ -0,0 +1,10 @@
+expr main (strike of luck)
+
+let message "Did you mean `stroke of luck`?"
+let description "Detects incorrect usage of `strike of luck` and suggests `stroke of luck` as the correct phrase."
+let kind "Usage"
+let becomes "stroke of luck"
+
+test "But that's a one in a million strike of luck" "But that's a one in a million stroke of luck"
+test "Is this a happy coincidence and a strike of luck?" "Is this a happy coincidence and a stroke of luck?"
+