Skip to content

Commit 51e0286

Browse files
authored
feat: escape goat → scapegoat (#2408)
1 parent d1793dc commit 51e0286

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

harper-core/src/linting/phrase_set_corrections/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@ pub fn lint_group() -> LintGroup {
358358
"Simplifies redundant double positives like `most optimal` to the base form.",
359359
LintKind::Redundancy
360360
),
361+
"ScapeGoat" => (
362+
&[
363+
("an escape goat", "a scapegoat"),
364+
("escape goat", "scapegoat"),
365+
("escape goats", "scapegoats"),
366+
],
367+
"If you're referring someone is being blamed unfairly, write it as a single word: `scapegoat`.",
368+
"Corrects `scape goat` to `scapegoat`, which is the proper term for a person blamed for others' failures.",
369+
LintKind::Eggcorn
370+
),
361371
"WreakHavoc" => (
362372
&[
363373
("wreck havoc", "wreak havoc"),

harper-core/src/linting/phrase_set_corrections/tests.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,40 @@ fn correct_passer_bys_hyphen() {
932932
// Piggyback
933933
// -none-
934934

935+
// RedundantSuperlatives
936+
// -none-
937+
938+
// ScapeGoat
939+
940+
#[test]
941+
fn fix_an_escape_goat() {
942+
assert_suggestion_result(
943+
"I see too many times the cable and ps thingy being used as an escape goat.",
944+
lint_group(),
945+
"I see too many times the cable and ps thingy being used as a scapegoat.",
946+
);
947+
}
948+
949+
#[test]
950+
fn fix_escape_goat() {
951+
assert_suggestion_result(
952+
"It helps shift the reason for the failure on to what the manager did not do (making them the escape goat when it fails).",
953+
lint_group(),
954+
"It helps shift the reason for the failure on to what the manager did not do (making them the scapegoat when it fails).",
955+
);
956+
}
957+
958+
#[test]
959+
fn fix_escape_goats() {
960+
assert_suggestion_result(
961+
"People might be using Americans as escape goats for this, but these mishearings are becoming as common as a bowl in a china shop!",
962+
lint_group(),
963+
"People might be using Americans as scapegoats for this, but these mishearings are becoming as common as a bowl in a china shop!",
964+
);
965+
}
966+
935967
// WreakHavoc
968+
// -none-
936969

937970
// Many to many tests
938971

0 commit comments

Comments
 (0)