Skip to content

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

feat: air → err in idioms (#4646)

Andrew Dunbar7e911ea574df
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index 97f032764..572095968 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -2546,6 +2546,13 @@
"label": "Ad Nauseam"
}
},
+ {
+ "Bool": {
+ "name": "AirToErr",
+ "state": true,
+ "label": "‘Air’ to ‘Err’"
+ }
+ },
{
"Bool": {
"name": "Albeit",
diff --git a/harper-core/src/linting/weir_rules/AirToErr.weir b/harper-core/src/linting/weir_rules/AirToErr.weir
new file mode 100644
index 000000000..e26505ea0
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/AirToErr.weir
@@ -0,0 +1,10 @@
+expr main [<(to air is human), air>, <(air on the side of), air>]
+
+let message "Did you mean `err`? The correct phrase uses the verb `err`."
+let description "Corrects `air` to `err` in common idioms."
+let kind "Spelling"
+let becomes "err"
+let strategy "MatchCase"
+
+test "Im inclined to air on the side of caution tyvm..." "Im inclined to err on the side of caution tyvm..."
+test "They say to air is human, but to forgive is divine." "They say to err is human, but to forgive is divine."