Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
fix: `description` and `message` were copypasted from another linter! (#2147)
Andrew Dunbard25107f47f24
diff --git a/harper-core/src/linting/all_intents_and_purposes.rs b/harper-core/src/linting/all_intents_and_purposes.rsindex 503a13618..eb5c88aab 100644--- a/harper-core/src/linting/all_intents_and_purposes.rs+++ b/harper-core/src/linting/all_intents_and_purposes.rs@@ -73,17 +73,22 @@ impl ExprLinter for AllIntentsAndPurposes {.map(|s| Suggestion::replace_with_match_case_str(s, whole_span.get_content(src))).collect::<Vec<_>>();+ let message = format!(+ "The correct form is '{} all intents and purposes'.",+ prep_text.iter().collect::<String>().to_ascii_lowercase()+ );+Some(Lint {span: whole_span,lint_kind: LintKind::Nonstandard,suggestions: suggs,- message: "The time period is redundant because it repeats what's already specified by the AM/PM indicator.".to_owned(),+ message,priority: 50,})}fn description(&self) -> &'static str {- "Finds redundant am/pm indicators used together with time periods such as 'in the morning' or 'at night'."+ "Finds and corrects common wrong forms of the phrase 'for all intents and purposes' / 'to all intents and purposes'."}}diff --git a/harper-core/tests/text/linters/The Constitution of the United States.snap.yml b/harper-core/tests/text/linters/The Constitution of the United States.snap.ymlindex 967692e24..a3140e7db 100644--- a/harper-core/tests/text/linters/The Constitution of the United States.snap.yml+++ b/harper-core/tests/text/linters/The Constitution of the United States.snap.yml@@ -1765,7 +1765,7 @@ Message: |668 | proposing Amendments, which, in either Case, shall be valid to all Intents and| ^~~~~~~~~~~~~~~~~~~669 | Purposes, as Part of this Constitution, when ratified by the Legislatures of- | ~~~~~~~~ The time period is redundant because it repeats what's already specified by the AM/PM indicator.+ | ~~~~~~~~ The correct form is 'to all intents and purposes'.Suggest:- Replace with: “to all Intents and Purposes”- Replace with: “for alL intents anD purposes”