Skip to content

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

feat: escape goat → scapegoat (#2408)

Andrew Dunbar51e02866aea0
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index a40b0c5e8..4be893b27 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -358,6 +358,16 @@ pub fn lint_group() -> LintGroup {
"Simplifies redundant double positives like `most optimal` to the base form.",
LintKind::Redundancy
),
+ "ScapeGoat" => (
+ &[
+ ("an escape goat", "a scapegoat"),
+ ("escape goat", "scapegoat"),
+ ("escape goats", "scapegoats"),
+ ],
+ "If you're referring someone is being blamed unfairly, write it as a single word: `scapegoat`.",
+ "Corrects `scape goat` to `scapegoat`, which is the proper term for a person blamed for others' failures.",
+ LintKind::Eggcorn
+ ),
"WreakHavoc" => (
&[
("wreck havoc", "wreak havoc"),
diff --git a/harper-core/src/linting/phrase_set_corrections/tests.rs b/harper-core/src/linting/phrase_set_corrections/tests.rs
index 02d937f14..b2ad1aa82 100644
--- a/harper-core/src/linting/phrase_set_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_set_corrections/tests.rs
@@ -932,7 +932,40 @@ fn correct_passer_bys_hyphen() {
// Piggyback
// -none-
+// RedundantSuperlatives
+// -none-
+
+// ScapeGoat
+
+#[test]
+fn fix_an_escape_goat() {
+ assert_suggestion_result(
+ "I see too many times the cable and ps thingy being used as an escape goat.",
+ lint_group(),
+ "I see too many times the cable and ps thingy being used as a scapegoat.",
+ );
+}
+
+#[test]
+fn fix_escape_goat() {
+ assert_suggestion_result(
+ "It helps shift the reason for the failure on to what the manager did not do (making them the escape goat when it fails).",
+ lint_group(),
+ "It helps shift the reason for the failure on to what the manager did not do (making them the scapegoat when it fails).",
+ );
+}
+
+#[test]
+fn fix_escape_goats() {
+ assert_suggestion_result(
+ "People might be using Americans as escape goats for this, but these mishearings are becoming as common as a bowl in a china shop!",
+ lint_group(),
+ "People might be using Americans as scapegoats for this, but these mishearings are becoming as common as a bowl in a china shop!",
+ );
+}
+
// WreakHavoc
+// -none-
// Many to many tests