Skip to content

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

feat(core): write rule to correct `cybersec` -> `cybersecurity` (#2613)

Elijah Pottere52dd0e64d5d
diff --git a/harper-core/src/linting/weir_rules/Cybersec.weir b/harper-core/src/linting/weir_rules/Cybersec.weir
new file mode 100644
index 000000000..e7edd293a
--- /dev/null
+++ b/harper-core/src/linting/weir_rules/Cybersec.weir
@@ -0,0 +1,26 @@
+expr main (cybersec)
+
+let message "Use `cybersecurity` instead of `cybersec`."
+let description "Expands the informal abbreviation `cybersec` to `cybersecurity`."
+let kind "Style"
+let becomes "cybersecurity"
+let strategy "MatchCase"
+
+test "We hired a cybersec analyst." "We hired a cybersecurity analyst."
+test "Cybersec teams are growing." "Cybersecurity teams are growing."
+test "CYBERSEC is a priority." "CYBERSECURITY is a priority."
+test "Our cybersec program needs funding." "Our cybersecurity program needs funding."
+test "They focus on cybersec in healthcare." "They focus on cybersecurity in healthcare."
+test "cybersec." "cybersecurity."
+test "cybersec," "cybersecurity,"
+test "cybersec?" "cybersecurity?"
+test "cybersec!" "cybersecurity!"
+test "The cybersec training starts Monday." "The cybersecurity training starts Monday."
+test "A cybersec role opened today." "A cybersecurity role opened today."
+test "We discussed cybersec risks." "We discussed cybersecurity risks."
+
+test "Cybersecurity is important." "Cybersecurity is important."
+test "cybersecurity is important." "cybersecurity is important."
+test "This is about cyber-sec systems." "This is about cyber-sec systems."
+test "We build cybersecops tooling." "We build cybersecops tooling."
+test "The cybersecx team is separate." "The cybersecx team is separate."