Skip to content

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

feat: cross platform→cross-platform (#3689)

Andrew Dunbarf61d7b0b0a4a
diff --git a/harper-core/default_config.json b/harper-core/default_config.json
index bf27cf88e..5c201d7f4 100644
--- a/harper-core/default_config.json
+++ b/harper-core/default_config.json
@@ -2346,6 +2346,13 @@
"state": true,
"label": "Wok Verb Typo"
}
+ },
+ {
+ "Bool": {
+ "name": "CrossPlatform",
+ "state": true,
+ "label": "Cross Platform"
+ }
}
]
}
diff --git a/harper-core/src/linting/weir_rules/CrossPlatform.weir b/harper-core/src/linting/weir_rules/CrossPlatform.weir
new file mode 100644
index 000000000..2ad3d145a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/CrossPlatform.weir
@@ -0,0 +1,10 @@
+expr main (cross platform)
+
+let message "`Cross-platform` should always be hyphenated in all positions."
+let description "Unlike some compound modifiers, `cross-platform` should always be hyphenated."
+let kind "Punctuation"
+let becomes "cross-platform"
+
+test "A C++11 single-file header-only cross platform HTTP/HTTPS library." "A C++11 single-file header-only cross-platform HTTP/HTTPS library."
+test "Cross Platform Tutorial." "Cross-Platform Tutorial."
+test "Cross platform / architecture install option" "Cross-platform / architecture install option"