Skip to content

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

feat: new `LintKind`s, optional `LintKind` param for `phrase_corrections` (#1596)

Andrew Dunbarf0f9d068b311
diff --git a/harper-core/src/linting/lint_kind.rs b/harper-core/src/linting/lint_kind.rs
index 1c707b939..eba99da04 100644
--- a/harper-core/src/linting/lint_kind.rs
+++ b/harper-core/src/linting/lint_kind.rs
@@ -9,20 +9,48 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, Serialize, Deserialize, Is, Default, Hash, PartialEq, Eq)]
pub enum LintKind {
Agreement,
+ /// For errors where words are joined or split at the wrong boundaries
+ /// (e.g., "each and everyone" vs. "each and every one")
+ BoundaryError,
Capitalization,
+ /// For cases where a word or phrase is misused for a similar-sounding word or phrase,
+ /// where the incorrect version makes logical sense (e.g., 'egg corn' for 'acorn',
+ /// 'on mass' for 'en masse').
+ Eggcorn,
+ /// For suggesting improvements that enhance clarity or impact without fixing errors
Enhancement,
Formatting,
+ Grammar,
+ /// For cases where a word is mistakenly used for a similar-sounding word with a different meaning
+ /// (e.g., 'eluded to' instead of 'alluded to'). Unlike eggcorns, these don't create new meanings.
+ Malapropism,
+ /// For any other lint that doesn't fit neatly into the other categories
#[default]
Miscellaneous,
+ Nonstandard,
+ /// For issues with punctuation, including hyphenation in compound adjectives
+ /// (e.g., "face first" vs. "face-first" when used before a noun)
Punctuation,
Readability,
+ /// For cases where words duplicate meaning that's already expressed
+ /// (e.g., "basic fundamentals" → "fundamentals", "free gift" → "gift")
Redundancy,
+ /// For variations that are standard in some regions or dialects but not others
Regionalism,
Repetition,
+ /// When your brain doesn't know the right spelling.
/// This should only be used by linters doing spellcheck on individual words.
Spelling,
+ /// For cases where multiple options are correct but one is preferred for style or clarity,
+ /// such as expanding abbreviations in formal writing (e.g., 'min' → 'minimum')
Style,
+ /// When your brain knows the right spelling but your fingers made a mistake.
+ /// (e.g., 'can be seem' → 'can be seen')
Typo,
+ /// For conventional word usage and standard collocations
+ /// (e.g., 'by accident' vs. 'on accident' in standard English)
+ Usage,
+ /// For choosing between different words or phrases in a given context
WordChoice,
}
@@ -30,9 +58,12 @@ impl LintKind {
pub fn new_from_str(s: &str) -> Option<Self> {
Some(match s {
"Agreement" => LintKind::Agreement,
+ "BoundaryError" => LintKind::BoundaryError,
"Capitalization" => LintKind::Capitalization,
+ "Eggcorn" => LintKind::Eggcorn,
"Enhancement" => LintKind::Enhancement,
"Formatting" => LintKind::Formatting,
+ "Grammar" => LintKind::Grammar,
"Miscellaneous" => LintKind::Miscellaneous,
"Readability" => LintKind::Readability,
"Redundancy" => LintKind::Redundancy,
@@ -50,10 +81,15 @@ impl LintKind {
pub fn to_string_key(&self) -> String {
match self {
LintKind::Agreement => "Agreement",
+ LintKind::BoundaryError => "BoundaryError",
LintKind::Capitalization => "Capitalization",
+ LintKind::Eggcorn => "Eggcorn",
LintKind::Enhancement => "Enhancement",
LintKind::Formatting => "Formatting",
+ LintKind::Grammar => "Grammar",
+ LintKind::Malapropism => "Malapropism",
LintKind::Miscellaneous => "Miscellaneous",
+ LintKind::Nonstandard => "Nonstandard",
LintKind::Punctuation => "Punctuation",
LintKind::Readability => "Readability",
LintKind::Redundancy => "Redundancy",
@@ -62,6 +98,7 @@ impl LintKind {
LintKind::Spelling => "Spelling",
LintKind::Style => "Style",
LintKind::Typo => "Typo",
+ LintKind::Usage => "Usage",
LintKind::WordChoice => "WordChoice",
}
.to_owned()
@@ -72,10 +109,15 @@ impl Display for LintKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = match self {
LintKind::Agreement => "Agreement",
+ LintKind::BoundaryError => "BoundaryError",
LintKind::Capitalization => "Capitalization",
+ LintKind::Eggcorn => "Eggcorn",
LintKind::Enhancement => "Enhancement",
LintKind::Formatting => "Formatting",
+ LintKind::Grammar => "Grammar",
+ LintKind::Malapropism => "Malapropism",
LintKind::Miscellaneous => "Miscellaneous",
+ LintKind::Nonstandard => "Nonstandard",
LintKind::Punctuation => "Punctuation",
LintKind::Readability => "Readability",
LintKind::Redundancy => "Redundancy",
@@ -84,6 +126,7 @@ impl Display for LintKind {
LintKind::Spelling => "Spelling",
LintKind::Style => "Style",
LintKind::Typo => "Typo",
+ LintKind::Usage => "Usage",
LintKind::WordChoice => "Word Choice",
};
diff --git a/harper-core/src/linting/map_phrase_linter.rs b/harper-core/src/linting/map_phrase_linter.rs
index 1cb3e6de7..4faef8ee9 100644
--- a/harper-core/src/linting/map_phrase_linter.rs
+++ b/harper-core/src/linting/map_phrase_linter.rs
@@ -11,6 +11,7 @@ pub struct MapPhraseLinter {
expr: Box<dyn Expr>,
correct_forms: Vec<String>,
message: String,
+ lint_kind: LintKind,
}
impl MapPhraseLinter {
@@ -19,12 +20,14 @@ impl MapPhraseLinter {
correct_forms: impl IntoIterator<Item = impl ToString>,
message: impl ToString,
description: impl ToString,
+ lint_kind: Option<LintKind>,
) -> Self {
Self {
description: description.to_string(),
expr,
correct_forms: correct_forms.into_iter().map(|f| f.to_string()).collect(),
message: message.to_string(),
+ lint_kind: lint_kind.unwrap_or(LintKind::Miscellaneous),
}
}
@@ -34,6 +37,7 @@ impl MapPhraseLinter {
[phrase],
format!("Did you mean the phrase `{phrase}`?"),
format!("Looks for slight improper modifications to the phrase `{phrase}`."),
+ None,
)
}
@@ -42,6 +46,7 @@ impl MapPhraseLinter {
correct_forms: impl IntoIterator<Item = impl ToString>,
message: impl ToString,
description: impl ToString,
+ lint_kind: Option<LintKind>,
) -> Self {
let patterns = LongestMatchOf::new(
phrase
@@ -53,7 +58,13 @@ impl MapPhraseLinter {
.collect(),
);
- Self::new(Box::new(patterns), correct_forms, message, description)
+ Self::new(
+ Box::new(patterns),
+ correct_forms,
+ message,
+ description,
+ lint_kind,
+ )
}
pub fn new_fixed_phrase(
@@ -61,12 +72,14 @@ impl MapPhraseLinter {
correct_forms: impl IntoIterator<Item = impl ToString>,
message: impl ToString,
description: impl ToString,
+ lint_kind: Option<LintKind>,
) -> Self {
Self::new(
Box::new(FixedPhrase::from_phrase(phrase.as_ref())),
correct_forms,
message,
description,
+ lint_kind,
)
}
@@ -81,7 +94,13 @@ impl MapPhraseLinter {
correct_form.to_string()
);
- Self::new_fixed_phrase(phrase, [correct_form], message, description)
+ Self::new_fixed_phrase(
+ phrase,
+ [correct_form],
+ message,
+ description,
+ Some(LintKind::Miscellaneous),
+ )
}
}
@@ -96,7 +115,7 @@ impl ExprLinter for MapPhraseLinter {
Some(Lint {
span,
- lint_kind: LintKind::Miscellaneous,
+ lint_kind: self.lint_kind,
suggestions: self
.correct_forms
.iter()
diff --git a/harper-core/src/linting/map_phrase_set_linter.rs b/harper-core/src/linting/map_phrase_set_linter.rs
index 093f5961f..39d9d96a1 100644
--- a/harper-core/src/linting/map_phrase_set_linter.rs
+++ b/harper-core/src/linting/map_phrase_set_linter.rs
@@ -12,6 +12,7 @@ pub struct MapPhraseSetLinter<'a> {
wrong_forms_to_correct_forms: &'a [(&'a str, &'a str)],
multi_wrong_forms_to_multi_correct_forms: &'a [(&'a [&'a str], &'a [&'a str])],
message: String,
+ lint_kind: LintKind,
}
impl<'a> MapPhraseSetLinter<'a> {
@@ -19,6 +20,7 @@ impl<'a> MapPhraseSetLinter<'a> {
wrong_forms_to_correct_forms: &'a [(&'a str, &'a str)],
message: impl ToString,
description: impl ToString,
+ lint_kind: Option<LintKind>,
) -> Self {
let expr = Box::new(LongestMatchOf::new(
wrong_forms_to_correct_forms
@@ -36,6 +38,7 @@ impl<'a> MapPhraseSetLinter<'a> {
wrong_forms_to_correct_forms,
multi_wrong_forms_to_multi_correct_forms: &[],
message: message.to_string(),
+ lint_kind: lint_kind.unwrap_or(LintKind::Miscellaneous),
}
}
@@ -43,6 +46,7 @@ impl<'a> MapPhraseSetLinter<'a> {
multi_wrong_forms_to_multi_correct_forms: &'a [(&'a [&'a str], &'a [&'a str])],
message: impl ToString,
description: impl ToString,
+ lint_kind: Option<LintKind>,
) -> Self {
let mut lmo = LongestMatchOf::new(Vec::new());
for (wrong_forms, _correct_forms) in multi_wrong_forms_to_multi_correct_forms {
@@ -58,6 +62,7 @@ impl<'a> MapPhraseSetLinter<'a> {
wrong_forms_to_correct_forms: &[],
multi_wrong_forms_to_multi_correct_forms,
message: message.to_string(),
+ lint_kind: lint_kind.unwrap_or(LintKind::Miscellaneous),
}
}
}
@@ -106,7 +111,7 @@ impl<'a> ExprLinter for MapPhraseSetLinter<'a> {
Some(Lint {
span,
- lint_kind: LintKind::Miscellaneous,
+ lint_kind: self.lint_kind,
suggestions,
message: self.message.to_string(),
priority: 31,
diff --git a/harper-core/src/linting/phrase_corrections/mod.rs b/harper-core/src/linting/phrase_corrections/mod.rs
index 67429915f..ae919af8f 100644
--- a/harper-core/src/linting/phrase_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_corrections/mod.rs
@@ -1,3 +1,5 @@
+use crate::linting::LintKind;
+
use super::{LintGroup, MapPhraseLinter};
#[cfg(test)]
@@ -10,7 +12,7 @@ pub fn lint_group() -> LintGroup {
macro_rules! add_exact_mappings {
($group:expr, {
- $($name:expr => ($input:expr, $corrections:expr, $hint:expr, $description:expr)),+ $(,)?
+ $($name:expr => ($input:expr, $corrections:expr, $hint:expr, $description:expr $(, $lint_kind:expr)?)),+ $(,)?
}) => {
$(
$group.add_expr_linter(
@@ -20,7 +22,8 @@ pub fn lint_group() -> LintGroup {
$input,
$corrections,
$hint,
- $description
+ $description,
+ None$(.or(Some($lint_kind)))?,
),
),
);
@@ -38,13 +41,15 @@ pub fn lint_group() -> LintGroup {
// The message to be shown with the error.
"The correct wording is `a couple more`, without the `of`.",
// A description of the rule.
- "Corrects `a couple of more` to `a couple more`."
+ "Corrects `a couple of more` to `a couple more`.",
+ LintKind::Redundancy
),
"AfterAWhile" => (
["after while"],
["after a while"],
"When describafterg a timeframe, use `a while`.",
- "Corrects the missing article after `after while` or `after awhile`, forming `after a while`."
+ "Corrects the missing article in `after while`, forming `after a while`.",
+ LintKind::Grammar
),
"AheadAnd" => (
["ahead an"],
@@ -56,133 +61,155 @@ pub fn lint_group() -> LintGroup {
["all of the sudden"],
["all of a sudden"],
"The phrase is `all of a sudden`, meaning `unexpectedly`.",
- "Corrects `all of the sudden` to `all of a sudden`."
+ "Corrects `all of the sudden` to `all of a sudden`.",
+ LintKind::Nonstandard
),
"ALongTime" => (
["along time"],
["a long time"],
"Use `a long time` for referring to a duration of time.",
- "Corrects `along time` to `a long time`."
+ "Corrects `along time` to `a long time`.",
+ LintKind::Grammar
),
"AlzheimersDisease" => (
["old-timers' disease"],
["Alzheimer’s disease"],
"Use the correct medical term.",
- "Fixes the common misnomer `old-timers' disease`, ensuring the correct medical term `Alzheimer’s disease` is used."
+ "Fixes the common misnomer `old-timers' disease`, ensuring the correct medical term `Alzheimer’s disease` is used.",
+ LintKind::Eggcorn
),
"AnAnother" => (
["an another", "a another"],
["another"],
"Use `another` on its own.",
- "Corrects `an another` and `a another`."
+ "Corrects `an another` and `a another`.",
+ LintKind::Redundancy
),
"AndIn" => (
["an in"],
["and in"],
"Did you mean `and in`?",
- "Fixes the incorrect phrase `an in` to `and in` for proper conjunction usage."
+ "Fixes the incorrect phrase `an in` to `and in` for proper conjunction usage.",
+ LintKind::Typo
),
"AndTheLike" => (
["an the like"],
["and the like"],
"Did you mean `and the like`?",
- "Fixes the typo in `and the like`."
+ "Fixes the typo in `and the like`.",
+ LintKind::Typo
),
"AnotherAn" => (
["another an"],
["another"],
"Use `another` on its own.",
- "Corrects `another an` to `another`."
+ "Corrects `another an` to `another`.",
+ LintKind::Redundancy
),
"AnotherOnes" => (
["another ones"],
["another one", "another one's", "other ones"],
"`another` is singular but `ones` is plural. Or maybe you meant the possessive `one's`.",
- "Corrects `another ones`."
+ "Corrects `another ones`.",
+ LintKind::Agreement
),
"AnotherThings" => (
["another things"],
["another thing", "other things"],
"`another` is singular but `things` is plural.",
- "Corrects `another things`."
+ "Corrects `another things`.",
+ LintKind::Agreement
),
"AsFarBackAs" => (
["as early back as"],
["as far back as"],
"Use `as far back as` for referring to a time in the past.",
- "Corrects nonstandard `as early back as` to `as far back as`."
+ "Corrects nonstandard `as early back as` to `as far back as`.",
+ LintKind::WordChoice
),
"AsItHappens" => (
["as it so happens"],
["as it happens"],
"Did you mean `as it happens`?",
- "Corrects `as it so happens` to `as it happens`."
+ "Corrects `as it so happens` to `as it happens`.",
+ LintKind::Usage
),
"AsOfLate" => (
["as of lately"],
["as of late"],
"The standard form is `as of late`.",
- "Corrects `as of lately` to `as of late`."
+ "Corrects `as of lately` to `as of late`.",
+ LintKind::WordChoice
),
"AsWell" => (
["aswell"],
["as well"],
"`as well` should be written as two words.",
- "Corrects `aswell` to `as well`."
+ "Corrects `aswell` to `as well`.",
+ LintKind::BoundaryError
),
"AtFaceValue" => (
["on face value"],
["at face value"],
"`at face value is more idiomatic and more common.",
- "Corrects `on face value` to the more usual `at face value`."
+ "Corrects `on face value` to the more usual `at face value`.",
+ LintKind::WordChoice
),
"AtTheEndOfTheDay" => (
["in the end of the day"],
["at the end of the day"],
"Did you mean `at the end of the day`?",
- "Corrects `in the end of the day` to `at the end of the day`."
+ "Corrects `in the end of the day` to `at the end of the day`.",
+ LintKind::WordChoice
),
"AvoidAndAlso" => (
["and also"],
["and"],
"Consider using just `and`.",
- "Reduces redundancy by replacing `and also` with `and`."
+ "Reduces redundancy by replacing `and also` with `and`.",
+ LintKind::Redundancy
),
"BadRap" => (
["bed rap", "bad rep"],
["bad rap"],
"Did you mean `bad rap`?",
- "Changes `bed rap` to the proper idiom `bad rap`."
+ "Changes `bed rap` to the proper idiom `bad rap`.",
+ LintKind::Eggcorn
),
"BanTogether" => (
["ban together"],
["band together"],
"Did you mean `band together`?",
- "Detects and corrects the common error of using `ban together` instead of the idiom `band together`, which means to unite or join forces."
+ "Detects and corrects the common error of using `ban together` instead of the idiom `band together`, which means to unite or join forces.",
+ LintKind::Eggcorn
),
"BareInMind" => (
["bare in mind"],
["bear in mind"],
"Did you mean `bear in mind`?",
- "Ensures the phrase `bear in mind` is used correctly instead of `bare in mind`."
+ "Ensures the phrase `bear in mind` is used correctly instead of `bare in mind`.",
+ LintKind::Eggcorn
),
"BatedBreath" => (
["baited breath"],
["bated breath"],
"Did you mean `bated breath`?",
- "Changes `baited breath` to the correct `bated breath`."
+ "Changes `baited breath` to the correct `bated breath`.",
+ LintKind::Eggcorn
),
"BeckAndCall" => (
["back and call"],
["beck and call"],
"Did you mean `beck and call`?",
- "Fixes `back and call` to `beck and call`."
+ "Fixes `back and call` to `beck and call`.",
+ LintKind::Eggcorn
),
"BeenThere" => (
["bee there"],
["been there"],
"Did you mean `been there`?",
- "Corrects the misspelling `bee there` to the proper phrase `been there`."
+ "Corrects the misspelling `bee there` to the proper phrase `been there`.",
+ LintKind::Typo
),
"Beforehand" => (
["before hand", "before-hand"],
@@ -194,19 +221,22 @@ pub fn lint_group() -> LintGroup {
["beat regards"],
["best regards"],
"Use `best regards` to convey sincere well wishes in a closing.",
- "In valedictions, `best` expresses your highest regard—avoid the typo `beat regards`."
+ "In valedictions, `best` expresses your highest regard—avoid the typo `beat regards`.",
+ LintKind::Typo
),
"BlanketStatement" => (
["blanketed statement"],
["blanket statement"],
"Use the more idiomatic phrasing.",
- "Corrects common errors in the phrase `blanket statement`."
+ "Corrects common errors in the phrase `blanket statement`.",
+ LintKind::Usage
),
"Brutality" => (
["brutalness"],
["brutality"],
"This word has a more standard, more common synonym.",
- "Suggests the more standard and common synonym `brutality`."
+ "Suggests the more standard and common synonym `brutality`.",
+ LintKind::WordChoice
),
"BuiltIn" => (
["in built", "in-built", "built in"],
@@ -218,199 +248,232 @@ pub fn lint_group() -> LintGroup {
["on accident"],
["by accident"],
"Did you mean `by accident`?",
- "Incorrect preposition: `by accident` is the idiomatic expression."
+ "Incorrect preposition: `by accident` is the idiomatic expression.",
+ LintKind::Usage
),
"CanBeSeen" => (
["can be seem"],
["can be seen"],
"Did you mean `can be seen`?",
- "Corrects `can be seem` to the proper phrase `can be seen`."
+ "Corrects `can be seem` to the proper phrase `can be seen`.",
+ LintKind::Typo
),
"CaseInPoint" => (
["case and point"],
["case in point"],
"`Case in point` is the correct form of the phrase.",
- "Corrects `case and point` to `case in point`."
+ "Corrects `case and point` to `case in point`.",
+ LintKind::Malapropism
),
"CaseSensitive" => (
["case sensitive"],
["case-sensitive"],
"Use the hyphenated form for `case-sensitive`.",
- "Ensures `case-sensitive` is correctly hyphenated."
+ "Ensures `case-sensitive` is correctly hyphenated.",
+ LintKind::Punctuation
),
"CondenseAllThe" => (
["all of the"],
["all the"],
"Consider simplifying to `all the`.",
- "Suggests removing `of` in `all of the` for a more concise phrase."
+ "Suggests removing `of` in `all of the` for a more concise phrase.",
+ LintKind::Redundancy
),
"CoursingThroughVeins" => (
["cursing through veins"],
["coursing through veins"],
"In this idiom, blood “courses” (flows) through veins, not “curses”.",
- "In English idioms, “to course” means to flow rapidly—so avoid the eggcorn `cursing through veins.`"
+ "In English idioms, “to course” means to flow rapidly—so avoid the eggcorn `cursing through veins.`",
+ LintKind::Eggcorn
),
"DampSquib" => (
["damp squid"],
["damp squib"],
"Use the correct phrase for a disappointing outcome.",
- "Corrects the eggcorn `damp squid` to `damp squib`, ensuring the intended meaning of a failed or underwhelming outcome."
+ "Corrects the eggcorn `damp squid` to `damp squib`, ensuring the intended meaning of a failed or underwhelming outcome.",
+ LintKind::Eggcorn
),
"DayAndAge" => (
["day in age"],
["day and age"],
"Use `day and age` for referring to the present time.",
- "Corrects the eggcorn `day in age` to `day and age`, which properly means the current era or time period."
+ "Corrects the eggcorn `day in age` to `day and age`, which properly means the current era or time period.",
+ LintKind::Eggcorn
),
"DoNotWant" => (
["don't wan", "do not wan"],
["don't want", "do not want"],
"Use the full verb “want” after negation: “don't want” or “do not want.”",
- "In English, negation still requires the complete verb form (“want”), so avoid truncating it to “wan.”"
+ "In English, negation still requires the complete verb form (“want”), so avoid truncating it to “wan.”",
+ LintKind::Typo
),
"EachAndEveryOne" => (
["each and everyone"],
["each and every one"],
"Use `each and every one` for referring to a group of people or things.",
- "Corrects `each and everyone` to `each and every one`."
+ "Corrects `each and everyone` to `each and every one`.",
+ LintKind::BoundaryError
),
"EludedTo" => (
["eluded to"],
["alluded to"],
"Did you mean `alluded to`?",
- "Corrects `eluded to` to `alluded to` in contexts referring to indirect references."
+ "Corrects `eluded to` to `alluded to` in contexts referring to indirect references.",
+ LintKind::Malapropism
),
"EnMasse" => (
["on mass", "on masse", "in mass"],
["en masse"],
"Did you mean `en masse`?",
- "Detects variants like `on mass` or `in mass` and suggests `en masse`."
+ "Detects variants like `on mass` or `in mass` and suggests `en masse`.",
+ LintKind::Eggcorn
),
"EnRoute" => (
["on route to", "in route to", "on-route to", "in-route to"],
["en route to", "en-route to"],
"Did you mean `en route`?",
- "Detects variants like `on route` or `in route` and suggests `en route`."
+ "Detects variants like `on route` or `in route` and suggests `en route`.",
+ LintKind::Eggcorn
),
"EverPresent" => (
["ever present"],
["ever-present"],
"Hyphenate `ever-present` when it functions as a compound adjective.",
- "Corrects the missing hyphen in `ever present` to the compound adjective `ever-present`."
+ "Corrects the missing hyphen in `ever present` to the compound adjective `ever-present`.",
+ LintKind::Punctuation
),
"Excellent" => (
["very good"],
["excellent"],
"Vocabulary enhancement: use `excellent` instead of `very good`",
- "Provides a stronger word choice by replacing `very good` with `excellent` for clarity and emphasis."
+ "Provides a stronger word choice by replacing `very good` with `excellent` for clarity and emphasis.",
+ LintKind::Enhancement
),
"ExpandBecause" => (
["cuz"],
["because"],
"Use `because` instead of informal `cuz`",
- "Expands the informal abbreviation `cuz` to the full word `because` for formality."
+ "Expands the informal abbreviation `cuz` to the full word `because` for formality.",
+ LintKind::Style
),
"ExpandMinimum" => (
["min"],
["minimum"],
"Use `minimum` instead of `min`",
- "Expands the abbreviation `min` to the full word `minimum` for clarity."
+ "Expands the abbreviation `min` to the full word `minimum` for clarity.",
+ LintKind::Style
),
"ExpandWith" => (
["w/"],
["with"],
"Use `with` instead of `w/`",
- "Expands the abbreviation `w/` to the full word `with` for clarity."
+ "Expands the abbreviation `w/` to the full word `with` for clarity.",
+ LintKind::Style
),
"ExpandWithout" => (
["w/o"],
["without"],
"Use `without` instead of `w/o`",
- "Expands the abbreviation `w/o` to the full word `without` for clarity."
+ "Expands the abbreviation `w/o` to the full word `without` for clarity.",
+ LintKind::Style
),
"Expatriate" => (
["ex-patriot"],
["expatriate"],
"Use the correct term for someone living abroad.",
- "Fixes the misinterpretation of `expatriate`, ensuring the correct term is used for individuals residing abroad."
+ "Fixes the misinterpretation of `expatriate`, ensuring the correct term is used for individuals residing abroad.",
+ LintKind::Eggcorn
),
"FaceFirst" => (
["face first into"],
["face-first into"],
"Should this be `face-first`?",
- "Ensures `face first` is correctly hyphenated as `face-first` when used before `into`."
+ "Ensures `face first` is correctly hyphenated as `face-first` when used before `into`.",
+ LintKind::Punctuation
),
"FairBit" => (
["fare bit"],
["fair bit"],
"A `decent amount` is a `fair bit`. `Fare` is the price of a ticket.",
- "Corrects malapropisms of `a fair bit`."
+ "Corrects malapropisms of `a fair bit`.",
+ LintKind::Eggcorn
),
"FastPaste" => (
["fast paste", "fast-paste"],
["fast-paced"],
"Did you mean `fast-paced`?",
- "Detects incorrect usage of `fast paste` or `fast-paste` and suggests `fast-paced` as the correct phrase."
+ "Detects incorrect usage of `fast paste` or `fast-paste` and suggests `fast-paced` as the correct phrase.",
+ LintKind::Eggcorn
),
"FatalOutcome" => (
["fatal outcome"],
["death"],
"Consider using `death` for clarity.",
- "Replaces `fatal outcome` with the more direct term `death` for conciseness."
+ "Replaces `fatal outcome` with the more direct term `death` for conciseness.",
+ LintKind::Style
),
"FetalPosition" => (
["the feeble position"],
["the fetal position"],
"Use the correct term for a curled-up posture.",
- "Ensures the correct use of `fetal position`, avoiding confusion with `feeble position`, which is not a standard phrase."
+ "Ensures the correct use of `fetal position`, avoiding confusion with `feeble position`, which is not a standard phrase.",
+ LintKind::Malapropism
),
"ForAllIntentsAndPurposes" => (
["for all intensive purposes"],
["for all intents and purposes"],
"Use the correct phrase meaning 'in every practical sense'.",
- "Corrects `for all intensive purposes` to `for all intents and purposes`, ensuring the phrase conveys its intended meaning."
+ "Corrects `for all intensive purposes` to `for all intents and purposes`, ensuring the phrase conveys its intended meaning.",
+ LintKind::Eggcorn
),
"ForALongTime" => (
["for along time"],
["for a long time"],
"Use the standard phrase `for a long time` to indicate an extended duration.",
- "Eliminates the incorrect merging in `for along time`."
+ "Eliminates the incorrect merging in `for along time`.",
+ LintKind::Grammar
),
"ForAWhile" => (
["for while"],
["for a while"],
"When describing a timeframe, use `a while`.",
- "Corrects the missing article in `for while` or `for awhile`, forming `for a while`."
+ "Corrects the missing article in `for while`, forming `for a while`.",
+ LintKind::Typo
),
"FreeRein" => (
["free reign"],
["free rein"],
"Use the correct phrase for unrestricted control.",
- "Ensures the correct use of `free rein`, avoiding confusion with `free reign`, which incorrectly suggests authority rather than freedom of action."
+ "Ensures the correct use of `free rein`, avoiding confusion with `free reign`, which incorrectly suggests authority rather than freedom of action.",
+ LintKind::Eggcorn
),
"Freezing" => (
["very cold", "really cold", "extremely cold"],
["freezing"],
"A more vivid adjective would better capture extreme cold.",
- "Encourages vivid writing by suggesting `freezing` instead of weaker expressions like `very cold.`"
+ "Encourages vivid writing by suggesting `freezing` instead of weaker expressions like `very cold.`",
+ LintKind::Enhancement
),
"FromTheGetGo" => (
["from the get go"],
["from the get-go"],
"Use the hyphenated form: `from the get-go`.",
- "Ensures `from the get-go` is correctly hyphenated, preserving the idiom’s meaning of ‘from the very beginning’."
+ "Ensures `from the get-go` is correctly hyphenated, preserving the idiom’s meaning of ‘from the very beginning’.",
+ LintKind::Punctuation
),
"GildedAge" => (
["guilded age"],
["Gilded Age"],
"The period of economic prosperity is called the `Gilded Age`.",
- "If referring to the period of economic prosperity, the correct term is `Gilded Age`."
+ "If referring to the period of economic prosperity, the correct term is `Gilded Age`.",
+ LintKind::Eggcorn
),
"GoingTo" => (
["gong to"],
["going to"],
"Did you mean `going to`?",
- "Corrects `gong to` to the intended phrase `going to`."
+ "Corrects `gong to` to the intended phrase `going to`.",
+ LintKind::Typo
),
"GuineaBissau" => (
// Note: this lint matches any case but cannot correct wrong case
@@ -421,187 +484,218 @@ pub fn lint_group() -> LintGroup {
["Guinea Bissau"],
["Guinea-Bissau"],
"The official spelling is hyphenated.",
- "Checks for the correct official name of the African country."
+ "Checks for the correct official name of the African country.",
+ LintKind::Punctuation
),
"HadOf" => (
["had of"],
["had have", "had've"],
"Did you mean `had have` or `had've`?",
- "Flags the unnecessary use of `of` after `had` and suggests the correct forms."
+ "Flags the unnecessary use of `of` after `had` and suggests the correct forms.",
+ LintKind::Grammar
),
"HalfAnHour" => (
["half an our"],
["half an hour"],
"Remember the silent 'h' when writing `hour`: `half an hour`.",
- "Fixes the eggcorn `half an our` to the accepted `half an hour`."
+ "Fixes the eggcorn `half an our` to the accepted `half an hour`.",
+ LintKind::Typo
),
"Haphazard" => (
["half hazard", "half-hazard", "halfhazard"],
["haphazard"],
"Use `haphazard` for randomness or lack of organization.",
- "Corrects the eggcorn `half hazard` to `haphazard`, which properly means lacking organization or being random."
+ "Corrects the eggcorn `half hazard` to `haphazard`, which properly means lacking organization or being random.",
+ LintKind::Eggcorn
),
"HumanBeings" => (
["human's beings", "humans beings"],
["human beings"],
"Use `human beings` to refer to people collectively.",
- "Eliminates the incorrect possessive/plural usage like `human's beings` or `humans beings`."
+ "Eliminates the incorrect possessive/plural usage like `human's beings` or `humans beings`.",
+ LintKind::Grammar
),
"HumanLife" => (
["human live"],
["human life"],
"Did you mean `human life`?",
- "Changes `human live` to `human life`."
+ "Changes `human live` to `human life`.",
+ LintKind::Typo
),
"HungerPang" => (
["hunger pain"],
["hunger pang"],
"Did you mean `hunger pang`?",
- "Corrects `hunger pain` to `hunger pang`."
+ "Corrects `hunger pain` to `hunger pang`.",
+ LintKind::Eggcorn
),
"IAm" => (
["I a m"],
["I am"],
"Did you mean `I am`?",
- "Fixes the incorrect spacing in `I a m` to properly form `I am`."
+ "Fixes the incorrect spacing in `I a m` to properly form `I am`.",
+ LintKind::Typo
),
"IAmAgreement" => (
["I are"],
["I am"],
"The first-person singular pronoun `I` requires the verb form `am`; `are` belongs to second-person or plural contexts.",
- "Corrects `I are` to `I am`."
+ "Corrects `I are` to `I am`.",
+ LintKind::Agreement
),
"IDo" => (
["I does"],
["I do"],
"`I` pairs with the bare verb `do`; the –s inflection `does` is reserved for third-person singular subjects.",
- "Corrects `I does` to `I do`."
+ "Corrects `I does` to `I do`.",
+ LintKind::Agreement
),
"InOfItself" => (
["in of itself"],
["in itself", "in and of itself"],
"Use `in itself` (more common) or `in and of itself` (more formal) to mean 'intrinsically'.",
- "Corrects nonstandard `in of itself` to standard `in itself` or `in and of itself`."
+ "Corrects nonstandard `in of itself` to standard `in itself` or `in and of itself`.",
+ LintKind::Usage
),
"InAnyWay" => (
["in anyway"],
["in any way"],
"Use `in any way` for emphasizing a point.",
- "Corrects ungrammatical `in anyway` to `in any way`."
+ "Corrects ungrammatical `in anyway` to `in any way`.",
+ LintKind::BoundaryError
),
"InAWhile" => (
["in while"],
["in a while"],
"When describing a timeframe, use `a while`.",
- "Corrects the missing article in `in while` or `in awhile`, forming `in a while`."
+ "Corrects the missing article in `in while`, forming `in a while`.",
+ LintKind::Grammar
),
"InCase" => (
["incase"],
["in case"],
"`In case` should be written as two words.",
- "Corrects `incase` to `in case`."
+ "Corrects `incase` to `in case`.",
+ LintKind::BoundaryError
),
"InNeedOf" => (
["in need for"],
["in need of"],
"Use `in need of` for when something is required or necessary.",
- "Corrects `in need for` to `in need of`."
+ "Corrects `in need for` to `in need of`.",
+ LintKind::Usage
),
"InOneFellSwoop" => (
["in one foul swoop"],
["in one fell swoop"],
"Use the correct phrase for something happening suddenly.",
- "Corrects `in one foul swoop` to `in one fell swoop`, preserving the phrase’s original meaning of sudden and complete action."
+ "Corrects `in one foul swoop` to `in one fell swoop`, preserving the phrase’s original meaning of sudden and complete action.",
+ LintKind::Eggcorn
),
"InsteadOf" => (
["in stead of"],
["instead of"],
"Use the modern single word `instead of` to indicate a replacement.",
- "Corrects the archaic or mistaken separation `in stead of` to `instead of` in everyday usage."
+ "Corrects the archaic or mistaken separation `in stead of` to `instead of` in everyday usage.",
+ LintKind::BoundaryError
),
"Insensitive" => (
["unsensitive"],
["insensitive"],
"This word has a more standard, more common synonym.",
- "Suggests the more standard and common synonym `insensitive`."
+ "Suggests the more standard and common synonym `insensitive`.",
+ LintKind::WordChoice
),
"Insurmountable" => (
["unsurmountable"],
["insurmountable"],
"This word has a more standard, more common synonym.",
- "Suggests the more standard and common synonym `insurmountable`."
+ "Suggests the more standard and common synonym `insurmountable`.",
+ LintKind::WordChoice
),
"Intact" => (
["in tact"],
["intact"],
"Use `intact` to mean undamaged or whole.",
- "Prevents the erroneous spacing in `in tact`; `intact` is the single correct word."
+ "Prevents the erroneous spacing in `in tact`; `intact` is the single correct word.",
+ LintKind::BoundaryError
),
"InThe" => (
["int he"],
["in the"],
"Did you mean `in the`?",
- "Detects and corrects a spacing error where `in the` is mistakenly written as `int he`. Proper spacing is essential for readability and grammatical correctness in common phrases."
+ "Detects and corrects a spacing error where `in the` is mistakenly written as `int he`. Proper spacing is essential for readability and grammatical correctness in common phrases.",
+ LintKind::Typo
),
"IsKnownFor" => (
["is know for"],
["is known for"],
"Did you mean `is known for`?",
- "Typo: `known` is the correct past participle."
+ "Typo: `known` is the correct past participle.",
+ LintKind::Typo
),
"ItCan" => (
["It cam"],
["It can"],
"Did you mean `It can`?",
- "Corrects the misspelling `It cam` to the proper phrase `It can`."
+ "Corrects the misspelling `It cam` to the proper phrase `It can`.",
+ LintKind::Typo
),
"IveGotTo" => (
["I've go to"],
["I've got to"],
"Use `I've got to` for necessity or obligation.",
- "Corrects the slip `I've go to` to the idiomatic `I've got to`."
+ "Corrects the slip `I've go to` to the idiomatic `I've got to`.",
+ LintKind::Typo
),
"JawDropping" => (
["jar-dropping"],
["jaw-dropping"],
"Use the correct phrase for something astonishing.",
- "Corrects `jar-dropping` to `jaw-dropping`, ensuring the intended meaning of something that causes amazement."
+ "Corrects `jar-dropping` to `jaw-dropping`, ensuring the intended meaning of something that causes amazement.",
+ LintKind::Eggcorn
),
"JustDeserts" => (
["just desserts"],
["just deserts"],
"Use the correct phrase for receiving what one deserves.",
- "Ensures `just deserts` is used correctly, preserving its meaning of receiving an appropriate outcome for one's actions."
+ "Ensures `just deserts` is used correctly, preserving its meaning of receiving an appropriate outcome for one's actions.",
+ LintKind::Spelling
),
"KindOf" => (
["kinda of"],
["kind of", "kinda"],
"`Kinda` already means `kind of`, so `kinda of` is redundant.",
- "Corrects `kinda of` to `kind of`."
+ "Corrects `kinda of` to `kind of`.",
+ LintKind::Redundancy
),
"KindRegards" => (
["kid regards"],
["kind regards"],
"Did you mean `kind regards`?",
- "Changes `kid regards` to `kind regards`."
+ "Changes `kid regards` to `kind regards`.",
+ LintKind::Typo
),
"LastButNotLeast" => (
["last but not the least", "last, but not the least", "last but, not least", "last but not last"],
["last but not least"],
"Use the more idiomatic phrasing.",
- "Corrects common errors in the phrase `last but not least`."
+ "Corrects common errors in the phrase `last but not least`.",
+ LintKind::Usage
),
"LastDitch" => (
["last ditch", "last ditched", "last-ditched"],
["last-ditch"],
"In this idiom, `ditch` is a noun and a hyphen is needed.",
- "Corrects wrong variations of the idiomatic adjective `last-ditch`."
+ "Corrects wrong variations of the idiomatic adjective `last-ditch`.",
+ LintKind::Usage
),
"LetAlone" => (
["let along"],
["let alone"],
"Did you mean `let alone`?",
- "Changes `let along` to `let alone`."
+ "Changes `let along` to `let alone`.",
+ LintKind::Typo
),
"LikeAsIf" => (
["like as if"],
@@ -613,104 +707,129 @@ pub fn lint_group() -> LintGroup {
["like a plague"],
["like the plague"],
"`Things are avoided `like the plague` not `like a plague`.",
- "Corrects `like a plague` to `like the plague`."
+ "Corrects `like a plague` to `like the plague`.",
+ LintKind::Usage
),
"LowHangingFruit" => (
["low hanging fruit", "low hanging fruits", "low-hanging fruits"],
["low-hanging fruit"],
"The standard form is `low-hanging fruit` with a hyphen and singular form.",
- "Corrects non-standard variants of `low-hanging fruit`."
+ "Corrects non-standard variants of `low-hanging fruit`.",
+ LintKind::Usage
),
"Monumentous" => (
["monumentous"],
["momentous", "monumental"],
"Retain `monumentous` for jocular effect. Otherwise `momentous` indicates great signifcance while `monumental` indicates imposing size.",
- "Advises using `momentous` or `monumental` instead of `monumentous` for serious usage."
+ "Advises using `momentous` or `monumental` instead of `monumentous` for serious usage.",
+ LintKind::Nonstandard
+ ),
+ "MorePreferable" => (
+ ["more preferable"],
+ ["preferable"],
+ "Use just `preferable` instead of `more preferable`.",
+ "Corrects `more preferable` to `preferable`.",
+ LintKind::Redundancy
),
"MyHouse" => (
["mu house"],
["my house"],
"Did you mean `my house`?",
- "Fixes the typo `mu house` to `my house`."
+ "Fixes the typo `mu house` to `my house`.",
+ LintKind::Typo
),
"NeedHelp" => (
["ned help"],
["need help"],
"Did you mean `need help`?",
- "Changes `ned help` to the correct `need help`."
+ "Changes `ned help` to the correct `need help`.",
+ LintKind::Typo
),
"NerveRacking" => (
["nerve racking", "nerve wracking", "nerve wrecking", "nerve-wracking", "nerve-wrecking"],
["nerve-racking"],
"Use `nerve-racking` for something that causes anxiety or tension.",
- "Corrects common misspellings and missing hyphen in `nerve-racking`."
+ "Corrects common misspellings and missing hyphen in `nerve-racking`.",
+ LintKind::Eggcorn
),
"NotIn" => (
["no in"],
["not in"],
"Use `not in` for correct grammar.",
- "Replaces `no in` with `not in`."
+ "Replaces `no in` with `not in`.",
+ LintKind::Typo
),
"NotTo" => (
["no to"],
["not to"],
"Did you mean `not to`?",
- "Corrects `no to` to `not to`, ensuring proper negation."
+ "Corrects `no to` to `not to`, ensuring proper negation.",
+ LintKind::Typo
),
"OfCourse" => (
// See also: `of_course.rs` for "of curse/corse" → "of course" corrections
["off course", "o course", "ofcourse"],
["of course"],
"Did you mean `of course`?",
- "Detects the common mistake `off course` and suggests the correct form `of course`."
+ "Detects the common mistake `off course` and suggests the correct form `of course`.",
+ LintKind::Eggcorn
),
"OffTheCuff" => (
["off the cuff"],
["off-the-cuff"],
"Use the hyphenated form for `off-the-cuff`.",
- "Ensures `off-the-cuff` is correctly hyphenated."
+ "Ensures `off-the-cuff` is correctly hyphenated.",
+ LintKind::Punctuation
),
"OldWivesTale" => (
["old wise tale"],
["old wives' tale"],
"Use the correct phrase for a superstition or myth.",
- "Corrects `old wise tale` to `old wives' tale`, preserving the phrase’s meaning as an unfounded traditional belief."
+ "Corrects `old wise tale` to `old wives' tale`, preserving the phrase’s meaning as an unfounded traditional belief.",
+ LintKind::Eggcorn
),
"OnceInAWhile" => (
["once a while", "once and a while"],
["once in a while"],
"The correct idiom is `once in a while`.",
- "Corrects two common malapropisms of `once in a while`."
+ "Corrects two common malapropisms of `once in a while`.",
+ LintKind::Usage
),
"OnSecondThought" => (
["on second though"],
["on second thought"],
"Idiomatic expression: use `on second thought` instead of `on second though`",
- "Replaces the nonstandard `on second though` with the common idiom `on second thought` to indicate reconsideration."
+ "Replaces the nonstandard `on second though` with the common idiom `on second thought` to indicate reconsideration.",
+ LintKind::Typo
),
"OnTheSpurOfTheMoment" => (
["on the spurt of the moment", "at the spur of the moment", "in the spur of the moment"],
["on the spur of the moment"],
"Use the correct phrase for acting spontaneously.",
- "Ensures the correct use of `on the spur of the moment`, avoiding nonstandard variations."
+ "Ensures the correct use of `on the spur of the moment`, avoiding nonstandard variations.",
+ // "spurt" is Eggcorn, the others are probably Usage
+ LintKind::Eggcorn
),
"OnTopOf" => (
["ontop of"],
["on top of"],
"Did you mean `on top of`?",
- "Corrects `ontop of` to `on top of`."
+ "Corrects `ontop of` to `on top of`.",
+ LintKind::BoundaryError
),
"PeaceOfMind" => (
["piece of mind"],
["peace of mind"],
"The phrase is `peace of mind`, meaning `calm`. A `piece` is a `part` of something.",
- "Corrects `piece of mind` to `peace of mind`."
+ "Corrects `piece of mind` to `peace of mind`.",
+ LintKind::Eggcorn
),
"PointsOfView" => (
["point of views"],
["points of view"],
"The correct plural is `points of view`.",
- "Corrects pluralizing the wrong noun in `point of view`."
+ "Corrects pluralizing the wrong noun in `point of view`.",
+ LintKind::Usage
),
"PortAuPrince" => (
// Note: this lint matches any case but cannot correct wrong case
@@ -721,7 +840,8 @@ pub fn lint_group() -> LintGroup {
["Port au Prince"],
["Port-au-Prince"],
"The official spelling is hyphenated.",
- "Checks for the correct official name of the capital of Haiti."
+ "Checks for the correct official name of the capital of Haiti.",
+ LintKind::Punctuation
),
"PortoNovo" => (
// Note: this lint matches any case but cannot correct wrong case
@@ -732,138 +852,161 @@ pub fn lint_group() -> LintGroup {
["Porto Novo"],
["Porto-Novo"],
"The official spelling is hyphenated.",
- "Checks for the correct official name of the capital of Benin."
+ "Checks for the correct official name of the capital of Benin.",
+ LintKind::Punctuation
),
"PrayingMantis" => (
["preying mantis"],
["praying mantis"],
"Use the insect's correct name.",
- "Corrects `preying mantis` to `praying mantis`, ensuring accurate reference to the insect’s characteristic pose."
+ "Corrects `preying mantis` to `praying mantis`, ensuring accurate reference to the insect’s characteristic pose.",
+ LintKind::Eggcorn
),
"RapidFire" => (
["rapid fire"],
["rapid-fire"],
"It is more idiomatic to hypenate `rapid-fire`.",
- "Checks to ensure writers hyphenate `rapid-fire`."
+ "Checks to ensure writers hyphenate `rapid-fire`.",
+ LintKind::Punctuation
),
"RealTrouper" => (
["real trooper"],
["real trouper"],
"Use the correct phrase for someone who perseveres.",
- "Ensures the correct use of `real trouper`, distinguishing it from `trooper`, which refers to a soldier or police officer."
+ "Ensures the correct use of `real trouper`, distinguishing it from `trooper`, which refers to a soldier or police officer.",
+ LintKind::Eggcorn
),
"RedundantIIRC" => (
["if IIRC", "IIRC correctly"], ["IIRC"],
"`IIRC` already means 'if I recall correctly', so adding 'if' or 'correctly' is redundant.",
- "Flags redundant use of 'if' or 'correctly' with 'IIRC', since 'IIRC' already stands for 'if I recall correctly'."
+ "Flags redundant use of 'if' or 'correctly' with 'IIRC', since 'IIRC' already stands for 'if I recall correctly'.",
+ LintKind::Redundancy
),
"RifeWith" => (
["ripe with"],
["rife with"],
"Use the correct phrase for something abundant.",
- "Corrects `ripe with` to `rife with`, preserving the phrase’s meaning of being filled with something, often undesirable."
+ "Corrects `ripe with` to `rife with`, preserving the phrase’s meaning of being filled with something, often undesirable.",
+ LintKind::Eggcorn
),
"RoadMap" => (
["roadmap"],
["road map"],
"Did you mean `road map`?",
- "Detects when `roadmap` is used instead of `road map`, prompting the correct spacing."
+ "Detects when `roadmap` is used instead of `road map`, prompting the correct spacing.",
+ LintKind::WordChoice
),
"SameAs" => (
["same then"],
["same as"],
"Did you mean `same as`?",
- "Corrects the incorrect phrase `same then` to the standard `same as`."
+ "Corrects the incorrect phrase `same then` to the standard `same as`.",
+ LintKind::Grammar
),
"ScantilyClad" => (
["scandally clad"],
["scantily clad"],
"Use the correct phrase for minimal attire.",
- "Fixes `scandally clad` to `scantily clad`, ensuring clarity in describing minimal attire."
+ "Fixes `scandally clad` to `scantily clad`, ensuring clarity in describing minimal attire.",
+ LintKind::Eggcorn
),
"SimpleGrammatical" => (
["simply grammatical"],
["simple grammatical"],
"Use `simple grammatical` for correct adjective usage.",
- "Corrects `simply grammatical` to `simple grammatical` for proper adjective usage."
+ "Corrects `simply grammatical` to `simple grammatical` for proper adjective usage.",
+ LintKind::Usage
),
"SneakingSuspicion" => (
["sneaky suspicion"],
["sneaking suspicion"],
"Did you mean `sneaking suspicion`?",
- "Changes `sneaky suspicion` to `sneaking suspicion`."
+ "Changes `sneaky suspicion` to `sneaking suspicion`.",
+ LintKind::Eggcorn
),
"SomebodyElses" => (
["somebody's else", "somebody's else's"],
["somebody else's"],
"This should be `somebody else's`?",
- "Corrects `somebody else's` when the `'s` is in the wrong place."
+ "Corrects `somebody else's` when the `'s` is in the wrong place.",
+ LintKind::Grammar
),
"SomeOfThe" => (
["some the"],
["some of the"],
"Add `of` to form the partitive phrase: `some of the`.",
- "Quantity words such as `some` normally take `of` before a definite article. Including `of` signals that you mean a subset of a larger set, preventing a momentary stumble in comprehension."
+ "Quantity words such as `some` normally take `of` before a definite article. Including `of` signals that you mean a subset of a larger set, preventing a momentary stumble in comprehension.",
+ LintKind::Typo
),
"SoonerOrLater" => (
["sooner than later"],
["sooner rather than later", "sooner or later"],
"Did you mean `sooner rather than later` or `sooner or later`?",
- "Fixes the improper phrase `sooner than later` by suggesting standard alternatives."
+ "Fixes the improper phrase `sooner than later` by suggesting standard alternatives.",
+ LintKind::Usage
),
"SpecialAttention" => (
["spacial attention"],
["special attention"],
"Did you mean `special attention`?",
- "Changes `spacial attention` to `special attention`."
+ "Changes `spacial attention` to `special attention`.",
+ LintKind::Typo
),
"SpokeTooSoon" => (
["spoke to soon"],
["spoke too soon"],
"Use the adverb `too` instead.",
- "Identifies common misuse of the preposition `to` in the phrase `spoke too soon`."
+ "Identifies common misuse of the preposition `to` in the phrase `spoke too soon`.",
+ LintKind::Grammar
),
"Starving" => (
["very hungry", "really hungry", "extremely hungry"],
["starving"],
"A more vivid adjective would better convey intense hunger.",
- "Encourages vivid writing by suggesting `starving` instead of weaker expressions like `very hungry.`"
+ "Encourages vivid writing by suggesting `starving` instead of weaker expressions like `very hungry.`",
+ LintKind::Enhancement
),
"StateOfTheArt" => (
["state of art"],
["state of the art"],
"Did you mean `state of the art`?",
- "Detects incorrect usage of `state of art` and suggests `state of the art` as the correct phrase."
+ "Detects incorrect usage of `state of art` and suggests `state of the art` as the correct phrase.",
+ LintKind::Usage
),
"StatuteOfLimitations" => (
["statue of limitations"],
["statute of limitations"],
"A `statue` is a sculpture; in legal terms, the correct word is `statute`.",
- "Corrects `statue of limitations` to `statute of limitations`."
+ "Corrects `statue of limitations` to `statute of limitations`.",
+ LintKind::Eggcorn
),
"SufficeItToSay" => (
["suffice to say"],
["suffice it to say"],
"`Suffice it to say` is the more standard and more common variant.",
- "Corrects `suffice to say` to `suffice it to say`."
+ "Corrects `suffice to say` to `suffice it to say`.",
+ LintKind::Usage
),
"SupposedTo" => (
["suppose to"],
["supposed to"],
"Did you mean `supposed to`?",
- "Fixes `suppose to` to the correct `supposed to`."
+ "Fixes `suppose to` to the correct `supposed to`.",
+ LintKind::Usage
),
"TakeItPersonally" => (
["take it personal"],
["take it personally"],
"The more standard, less colloquial form is `take it personally`.",
- "Corrects `take it personal` to `take it personally`."
+ "Corrects `take it personal` to `take it personally`.",
+ LintKind::Usage
),
"ThanksALot" => (
["thanks lot", "thanks alot"],
["thanks a lot"],
"Prefer the two-word expression `thanks a lot`.",
- "`Thanks a lot` is the fixed, widely accepted form, while variants like `thanks lot` or `thanks alot` are non-standard and can jar readers."
+ "`Thanks a lot` is the fixed, widely accepted form, while variants like `thanks lot` or `thanks alot` are non-standard and can jar readers.",
+ LintKind::Usage
),
"ThatChallenged" => (
["the challenged"],
@@ -875,25 +1018,29 @@ pub fn lint_group() -> LintGroup {
["the this"],
["that this"],
"Did you mean `that this`?",
- "Fixes `the this` to the correct phrase `that this`."
+ "Fixes `the this` to the correct phrase `that this`.",
+ LintKind::Typo
),
"TheAnother" => (
["the another"],
["the other", "another"],
"Use `the other` or `another`, not both.",
- "Corrects `the another`."
+ "Corrects `the another`.",
+ LintKind::Grammar
),
"ThoughtProcess" => (
["though process"],
["thought process"],
"Did you mean `thought process`?",
- "Changes `though process` to `thought process`."
+ "Changes `though process` to `thought process`.",
+ LintKind::Typo
),
"TickingTimeClock" => (
["ticking time clock"],
["ticking time bomb", "ticking clock"],
"Use `ticking time bomb` for disastrous consequences, otherwise avoid redundancy with just `ticking clock`.",
- "Corrects `ticking time clock` to `ticking time bomb` for idiomatic urgency or `ticking clock` otherwise."
+ "Corrects `ticking time clock` to `ticking time bomb` for idiomatic urgency or `ticking clock` otherwise.",
+ LintKind::Usage
),
"ToDoHyphen" => (
["todo"],
@@ -905,31 +1052,36 @@ pub fn lint_group() -> LintGroup {
["to the manor born"],
["to the manner born"],
"Use the correct phrase for being naturally suited to something.",
- "Corrects `to the manor born` to `to the manner born`, ensuring the intended meaning of being naturally suited to a way of life."
+ "Corrects `to the manor born` to `to the manner born`, ensuring the intended meaning of being naturally suited to a way of life.",
+ LintKind::Eggcorn
),
"Towards" => (
["to towards"],
["towards"],
"Use `towards` without the preceding `to`.",
- "Removes redundant `to` before `towards`."
+ "Removes redundant `to` before `towards`.",
+ LintKind::Redundancy
),
"TrialAndError" => (
["trail and error"],
["trial and error"],
"You misspelled `trial`.",
- "Corrects `trail` to `trial` in `trial and error`."
+ "Corrects `trail` to `trial` in `trial and error`.",
+ LintKind::Typo
),
"TurnItOff" => (
["turn it of", "turn i of"],
["turn it off"],
"Did you mean `turn it off`?",
- "Fixes the mistake in the phrase `turn it off`."
+ "Fixes the mistake in the phrase `turn it off`.",
+ LintKind::Typo
),
"Unless" => (
["unless if"],
["unless", "except if", "except when"],
"`Unless if` is not idiomatic English. `Unless`, `except if`, and `except when` express a condition that is true in all cases except one.",
- "Corrects `unless if`."
+ "Corrects `unless if`.",
+ LintKind::Usage
),
"WantBe" => (
["want be"],
@@ -941,32 +1093,37 @@ pub fn lint_group() -> LintGroup {
["wavefunction"],
["wave function"],
"Did you mean `wave function`?",
- "Identifies the mistake of merging `wave` and `function` into one word. In quantum mechanics, a `wave function` (written as two words) describes the mathematical function that represents the quantum state of a particle or system. Correct usage is crucial for clear and accurate scientific communication."
+ "Identifies the mistake of merging `wave` and `function` into one word. In quantum mechanics, a `wave function` (written as two words) describes the mathematical function that represents the quantum state of a particle or system. Correct usage is crucial for clear and accurate scientific communication.",
+ LintKind::WordChoice
),
"WellBeing" => (
["wellbeing"],
["well-being"],
"Use the hyphenated form for `well-being`.",
- "Ensures `well-being` is correctly hyphenated."
+ "Ensures `well-being` is correctly hyphenated.",
+ LintKind::Punctuation
),
"WellKept" => (
["highly-kept", "highly kept"],
// There may be other good alternatives such as closely-guarded or tightly-held
["well-kept"],
"`Highly-kept` is not standard. To describe secrets, `well-kept` is the most used phrase.",
- "Flags `highly-kept` and recommends `well-kept` as an alternative."
+ "Flags `highly-kept` and recommends `well-kept` as an alternative.",
+ LintKind::Usage
),
"WhetYourAppetite" => (
["wet your appetite"],
["whet your appetite"],
"Use the correct phrase for stimulating desire.",
- "Ensures `whet your appetite` is used correctly, distinguishing it from the incorrect `wet` variation."
+ "Ensures `whet your appetite` is used correctly, distinguishing it from the incorrect `wet` variation.",
+ LintKind::Eggcorn
),
"WillContain" => (
["will contains"],
["will contain"],
"Did you mean `will contain`?",
- "Incorrect verb form: `will` should be followed by the base form `contain`."
+ "Incorrect verb form: `will` should be followed by the base form `contain`.",
+ LintKind::Agreement
),
// WorseOrWorst corrects wrong words. This corrects hyphenation.
// The descriptions and messages differ between the two linters.
@@ -974,13 +1131,15 @@ pub fn lint_group() -> LintGroup {
["worst case scenario", "worst-case-scenario"],
["worst-case scenario"],
"Hyphenate `worst-case`.",
- "Corrects `worst-case scenario` when the hyphen is missing or `worse` is used instead of `worst`."
+ "Corrects `worst-case scenario` when the hyphen is missing or `worse` is used instead of `worst`.",
+ LintKind::Punctuation
),
"WroughtIron" => (
["rod iron", "rot iron", "rod-iron", "rot-iron"],
["wrought iron"],
"Prefer the standard term `wrought iron`.",
- "`Wrought iron` is low-carbon, malleable iron used for decorative work; variants like `rod iron` or `rot iron` are phonetic misspellings that may confuse readers."
+ "`Wrought iron` is low-carbon, malleable iron used for decorative work; variants like `rod iron` or `rot iron` are phonetic misspellings that may confuse readers.",
+ LintKind::Eggcorn
),
});
diff --git a/harper-core/src/linting/phrase_corrections/tests.rs b/harper-core/src/linting/phrase_corrections/tests.rs
index 9c2c92224..38c93b537 100644
--- a/harper-core/src/linting/phrase_corrections/tests.rs
+++ b/harper-core/src/linting/phrase_corrections/tests.rs
@@ -855,6 +855,16 @@ fn detect_monumentous_real_world() {
);
}
+// MorePreferable
+#[test]
+fn correct_more_preferable() {
+ assert_suggestion_result(
+ "Is it more preferable to use process.env.variable or env.parsed.variable?",
+ lint_group(),
+ "Is it preferable to use process.env.variable or env.parsed.variable?",
+ );
+}
+
// MyHouse
// -none-
diff --git a/harper-core/src/linting/phrase_set_corrections/mod.rs b/harper-core/src/linting/phrase_set_corrections/mod.rs
index f50988ca0..6c54aab57 100644
--- a/harper-core/src/linting/phrase_set_corrections/mod.rs
+++ b/harper-core/src/linting/phrase_set_corrections/mod.rs
@@ -1,3 +1,5 @@
+use crate::linting::LintKind;
+
use super::{LintGroup, MapPhraseSetLinter};
#[cfg(test)]
@@ -10,7 +12,7 @@ pub fn lint_group() -> LintGroup {
// Each correction pair has a single bad form and a single correct form.
macro_rules! add_1_to_1_mappings {
($group:expr, {
- $($name:expr => ($input_correction_pairs:expr, $message:expr, $description:expr)),+ $(,)?
+ $($name:expr => ($input_correction_pairs:expr, $message:expr, $description:expr $(, $lint_kind:expr)?)),+ $(,)?
}) => {
$(
$group.add_expr_linter(
@@ -19,7 +21,8 @@ pub fn lint_group() -> LintGroup {
MapPhraseSetLinter::one_to_one(
$input_correction_pairs,
$message,
- $description
+ $description,
+ None$(.or(Some($lint_kind)))?,
),
),
);
@@ -30,7 +33,7 @@ pub fn lint_group() -> LintGroup {
// Each correction pair has multiple bad forms and multiple correct forms.
macro_rules! add_many_to_many_mappings {
($group:expr, {
- $($name:expr => ($input_correction_multi_pairs:expr, $message:expr, $description:expr)),+ $(,)?
+ $($name:expr => ($input_correction_multi_pairs:expr, $message:expr, $description:expr $(, $lint_kind:expr)?)),+ $(,)?
}) => {
$(
$group.add_expr_linter(
@@ -39,7 +42,8 @@ pub fn lint_group() -> LintGroup {
MapPhraseSetLinter::many_to_many(
$input_correction_multi_pairs,
$message,
- $description
+ $description,
+ None$(.or(Some($lint_kind)))?,
),
),
);
@@ -54,7 +58,8 @@ pub fn lint_group() -> LintGroup {
("much adieu", "much ado"),
],
"Don't confuse the French/German `adieu`, meaning `farewell`, with the English `ado`, meaning `fuss`.",
- "Corrects `adieu` to `ado`."
+ "Corrects `adieu` to `ado`.",
+ LintKind::Eggcorn
),
"ChampAtTheBit" => (
&[
@@ -64,7 +69,8 @@ pub fn lint_group() -> LintGroup {
("chomps at the bit", "champs at the bit"),
],
"The correct idiom is `champ at the bit`.",
- "Corrects `chomp at the bit` to the idiom `champ at the bit`, which has an equestrian origin referring to the way an anxious horse grinds its teeth against the metal part of the bridle."
+ "Corrects `chomp at the bit` to the idiom `champ at the bit`, which has an equestrian origin referring to the way an anxious horse grinds its teeth against the metal part of the bridle.",
+ LintKind::Eggcorn
),
"ClientOrServerSide" => (
&[
@@ -72,7 +78,8 @@ pub fn lint_group() -> LintGroup {
("server's side", "server-side"),
],
"`Client-side` and `server-side` do not use an apostrophe.",
- "Corrects extraneous apostrophe in `client's side` and `server's side`."
+ "Corrects extraneous apostrophe in `client's side` and `server's side`.",
+ LintKind::Punctuation
),
"DefiniteArticle" => (
&[
@@ -80,7 +87,8 @@ pub fn lint_group() -> LintGroup {
("definitive articles", "definite articles")
],
"The correct term for `the` is `definite article`.",
- "The name of the word `the` is `definite article`."
+ "The name of the word `the` is `definite article`.",
+ LintKind::Usage
),
"Discuss" => (
&[
@@ -90,7 +98,9 @@ pub fn lint_group() -> LintGroup {
("discussing about", "discussing"),
],
"`About` is redundant",
- "Removes unnecessary `about` after `discuss`."
+ "Removes unnecessary `about` after `discuss`.",
+ // or maybe Redundancy?
+ LintKind::Usage
),
"ExpandArgument" => (
&[
@@ -98,7 +108,8 @@ pub fn lint_group() -> LintGroup {
("args", "arguments"),
],
"Use `argument` instead of `arg`",
- "Expands the abbreviation `arg` to the full word `argument` for clarity."
+ "Expands the abbreviation `arg` to the full word `argument` for clarity.",
+ LintKind::Style
),
"ExpandDependencies" => (
&[
@@ -106,7 +117,8 @@ pub fn lint_group() -> LintGroup {
("dep", "dependency"),
],
"Use `dependencies` instead of `deps`",
- "Expands the abbreviation `deps` to the full word `dependencies` for clarity."
+ "Expands the abbreviation `deps` to the full word `dependencies` for clarity.",
+ LintKind::Style
),
"ExpandStandardInputAndOutput" => (
&[
@@ -115,7 +127,8 @@ pub fn lint_group() -> LintGroup {
("stderr", "standard error"),
],
"Use `standard input`, `standard output`, and `standard error` instead of `stdin`, `stdout`, and `stderr`",
- "Expands the abbreviations `stdin`, `stdout`, and `stderr` to the full words `standard input`, etc. for clarity."
+ "Expands the abbreviations `stdin`, `stdout`, and `stderr` to the full words `standard input`, etc. for clarity.",
+ LintKind::Style
),
"ExplanationMark" => (
&[
@@ -124,7 +137,8 @@ pub fn lint_group() -> LintGroup {
("explanation point", "exclamation point"),
],
"The correct names for the `!` punctuation are `exclamation mark` and `exclamation point`.",
- "Corrects the eggcorn `explanation mark/point` to `exclamation mark/point`."
+ "Corrects the eggcorn `explanation mark/point` to `exclamation mark/point`.",
+ LintKind::Usage
),
"ExtendOrExtent" => (
&[
@@ -134,7 +148,9 @@ pub fn lint_group() -> LintGroup {
("to the extend that", "to the extent that")
],
"Use `extent` for the noun and `extend` for the verb.",
- "Corrects `extend` to `extent` when the context is a noun."
+ "Corrects `extend` to `extent` when the context is a noun.",
+ // ConfusedPair??
+ LintKind::WordChoice
),
"HaveGone" => (
&[
@@ -144,7 +160,8 @@ pub fn lint_group() -> LintGroup {
("having went", "having gone"),
],
"`Have gone` is the correct form.",
- "Corrects `have went` to `have gone`."
+ "Corrects `have went` to `have gone`.",
+ LintKind::Grammar
),
"HavePassed" => (
&[
@@ -154,7 +171,9 @@ pub fn lint_group() -> LintGroup {
("having past", "having passed"),
],
"Did you mean the verb `passed`?",
- "Suggests `past` for `passed` in case a verb was intended."
+ "Suggests `past` for `passed` in case a verb was intended.",
+ // ConfusedPair?
+ LintKind::WordChoice
),
"HomeInOn" => (
&[
@@ -164,7 +183,8 @@ pub fn lint_group() -> LintGroup {
("honing in on", "homing in on"),
],
"Use `home in on` rather than `hone in on`",
- "Corrects `hone in on` to `home in on`."
+ "Corrects `hone in on` to `home in on`.",
+ LintKind::Eggcorn
),
"InDetail" => (
&[
@@ -172,7 +192,8 @@ pub fn lint_group() -> LintGroup {
("in more details", "in more detail"),
],
"Use singular `in detail` for referring to a detailed description.",
- "Corrects unidiomatic plural `in details` to `in detail`."
+ "Corrects unidiomatic plural `in details` to `in detail`.",
+ LintKind::Usage
),
"InvestIn" => (
&[
@@ -182,7 +203,8 @@ pub fn lint_group() -> LintGroup {
("invests into", "invests in"),
],
"Traditionally `invest` uses the preposition `in`.",
- "`Invest` is traditionally followed by 'in,' not `into.`"
+ "`Invest` is traditionally followed by 'in,' not `into.`",
+ LintKind::Usage
),
"MakeDoWith" => (
&[
@@ -200,7 +222,8 @@ pub fn lint_group() -> LintGroup {
("point is mute", "point is moot"),
],
"Use `moot` instead of `mute` when referring to a debatable or irrelevant point.",
- "Corrects `mute` to `moot` in the phrase `moot point`."
+ "Corrects `mute` to `moot` in the phrase `moot point`.",
+ LintKind::Eggcorn
),
"OperatingSystem" => (
&[
@@ -208,7 +231,8 @@ pub fn lint_group() -> LintGroup {
("operative systems", "operating systems"),
],
"Did you mean `operating system`?",
- "Ensures `operating system` is used correctly instead of `operative system`."
+ "Ensures `operating system` is used correctly instead of `operative system`.",
+ LintKind::Usage
),
"Piggyback" => (
&[
@@ -217,7 +241,8 @@ pub fn lint_group() -> LintGroup {
("piggy bagging", "piggybacking"),
],
"Did you mean `piggyback`?",
- "Corrects the eggcorn `piggy bag` to `piggyback`, which is the proper term for riding on someone’s back or using an existing system."
+ "Corrects the eggcorn `piggy bag` to `piggyback`, which is the proper term for riding on someone’s back or using an existing system.",
+ LintKind::Eggcorn
),
});
@@ -235,7 +260,8 @@ pub fn lint_group() -> LintGroup {
(&["changing of tact", "changing of tacks", "changing of tacts"], &["changing of tack"])
],
"A change in direction or approach is a change of `tack`. Not `tact` (or `tacks` or `tacts`).",
- "Locates errors in the idioms `to change tack` and `change of tack` to convey the correct meaning of altering one's course or strategy."
+ "Locates errors in the idioms `to change tack` and `change of tack` to convey the correct meaning of altering one's course or strategy.",
+ LintKind::Eggcorn
),
"GetRidOf" => (
&[
@@ -246,7 +272,8 @@ pub fn lint_group() -> LintGroup {
(&["gotten rid off", "gotten ride of", "gotten ride off"], &["gotten rid of"]),
],
"The idiom is `to get rid of`, not `off` or `ride`.",
- "Corrects common misspellings of the idiom `get rid of`."
+ "Corrects common misspellings of the idiom `get rid of`.",
+ LintKind::Typo
),
"HowItLooksLike" => (
&[
@@ -256,7 +283,8 @@ pub fn lint_group() -> LintGroup {
(&["how they look like", "how they looks like"], &["how they look", "what they look like"]),
],
"Don't use both `how` and `like` together to express similarity.",
- "Corrects `how ... looks like` to `how ... looks` or `what ... looks like`."
+ "Corrects `how ... looks like` to `how ... looks` or `what ... looks like`.",
+ LintKind::Grammar
),
"RiseTheQuestion" => (
&[
@@ -266,7 +294,8 @@ pub fn lint_group() -> LintGroup {
(&["rising the question"], &["raising the question"])
],
"Use `raise` instead of `rise` when referring to the act of asking a question.",
- "Corrects `rise the question` to `raise the question`."
+ "Corrects `rise the question` to `raise the question`.",
+ LintKind::Grammar
),
"WholeEntire" => (
&[
@@ -275,13 +304,13 @@ pub fn lint_group() -> LintGroup {
(&["a whole entire"], &["a whole", "an entire"]),
],
"Avoid redundancy. Use either `whole` or `entire` for referring to the complete amount or extent.",
- "Corrects the redundancy in `whole entire` to `whole` or `entire`."
+ "Corrects the redundancy in `whole entire` to `whole` or `entire`.",
+ LintKind::Redundancy
),
"WorseOrWorst" => (
&[
// worst -> worse
(&["a lot worst", "alot worst"], &["a lot worse"]),
-
(&["become worst"], &["become worse"]),
(&["became worst"], &["became worse"]),
(&["becomes worst"], &["becomes worse"]),
@@ -301,7 +330,8 @@ pub fn lint_group() -> LintGroup {
(&["worse ever"], &["worst ever"]),
],
"`Worse` is for comparing and `worst` is for the extreme case.",
- "Corrects `worse` and `worst` used in contexts where the other belongs."
+ "Corrects `worse` and `worst` used in contexts where the other belongs.",
+ LintKind::Agreement
)
});
diff --git a/harper-core/tests/text/linters/Alice's Adventures in Wonderland.snap.yml b/harper-core/tests/text/linters/Alice's Adventures in Wonderland.snap.yml
index f33a4fb54..f6b525f7d 100644
--- a/harper-core/tests/text/linters/Alice's Adventures in Wonderland.snap.yml
+++ b/harper-core/tests/text/linters/Alice's Adventures in Wonderland.snap.yml
@@ -90,7 +90,7 @@ Message: |
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
57 | lessons in the schoolroom, and though this was not a very good opportunity for
| ^~~~~~~~~ Vocabulary enhancement: use `excellent` instead of `very good`
@@ -331,7 +331,7 @@ Message: |
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
162 | sharply; “I advise you to leave off this minute!” She generally gave herself
163 | very good advice, (though she very seldom followed it), and sometimes she
@@ -902,7 +902,7 @@ Message: |
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
564 | wonder?” Alice guessed in a moment that it was looking for the fan and the pair
565 | of white kid gloves, and she very good-naturedly began hunting about for them,
@@ -1208,7 +1208,7 @@ Message: |
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
929 | “It is a very good height indeed!” said the Caterpillar angrily, rearing itself
| ^~~~~~~~~ Vocabulary enhancement: use `excellent` instead of `very good`
diff --git a/harper-core/tests/text/linters/Difficult sentences.snap.yml b/harper-core/tests/text/linters/Difficult sentences.snap.yml
index a9018bde6..95e22173a 100644
--- a/harper-core/tests/text/linters/Difficult sentences.snap.yml
+++ b/harper-core/tests/text/linters/Difficult sentences.snap.yml
@@ -96,7 +96,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Typo (31 priority)
Message: |
243 | His parents got him an in with the company.
| ^~~~~ Did you mean `and in`?
@@ -256,7 +256,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Redundancy (31 priority)
Message: |
343 | All of the responsibility is on him.
| ^~~~~~~~~~ Consider simplifying to `all the`.
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.yml
index 60691674b..94d6b629d 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
@@ -238,7 +238,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Redundancy (31 priority)
Message: |
103 | The Senate shall chuse their other Officers, and also a President pro tempore,
| ^~~~~~~~ Consider using just `and`.
diff --git a/harper-core/tests/text/linters/The Great Gatsby.snap.yml b/harper-core/tests/text/linters/The Great Gatsby.snap.yml
index b04f68c40..2739b08f3 100644
--- a/harper-core/tests/text/linters/The Great Gatsby.snap.yml
+++ b/harper-core/tests/text/linters/The Great Gatsby.snap.yml
@@ -46,7 +46,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Redundancy (31 priority)
Message: |
15 | consequence, I’m inclined to reserve all judgments, a habit that has opened up
16 | many curious natures to me and also made me the victim of not a few veteran
@@ -746,7 +746,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
583 | here this summer. I think the home influence will be very good for her.”
| ^~~~~~~~~ Vocabulary enhancement: use `excellent` instead of `very good`
@@ -1892,7 +1892,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
1457 | “I thought you knew, old sport. I’m afraid I’m not a very good host.”
| ^~~~~~~~~ Vocabulary enhancement: use `excellent` instead of `very good`
@@ -3859,7 +3859,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
2594 | “Looks very good,” he remarked vaguely. “One of the papers said they thought the
| ^~~~~~~~~ Vocabulary enhancement: use `excellent` instead of `very good`
@@ -4475,7 +4475,7 @@ Suggest:
-Lint: Miscellaneous (31 priority)
+Lint: Enhancement (31 priority)
Message: |
3141 | “Very good roads around here.”
| ^~~~~~~~~ Vocabulary enhancement: use `excellent` instead of `very good`
diff --git a/packages/chrome-plugin/src/lintKindColor.ts b/packages/chrome-plugin/src/lintKindColor.ts
index e8d3f1ab3..2c0cbda60 100644
--- a/packages/chrome-plugin/src/lintKindColor.ts
+++ b/packages/chrome-plugin/src/lintKindColor.ts
@@ -1,17 +1,24 @@
// First, define the color map as a constant
const LINT_KIND_COLORS = {
Agreement: '#228B22', // Forest green
+ BoundaryError: '#8B4513', // Saddle brown
Capitalization: '#540D6E', // Deep purple
+ Eggcorn: '#FF8C00', // Dark orange
Enhancement: '#0EAD69', // Green
Formatting: '#7D3C98', // Amethyst purple
+ Grammar: '#9B59B6', // Medium purple
+ Malapropism: '#C71585', // Medium violet red
Miscellaneous: '#3BCEAC', // Turquoise
+ Nonstandard: '#008B8B', // Dark cyan
Punctuation: '#D4850F', // Dark orange
Readability: '#2E8B57', // Sea green
+ Redundancy: '#4682B4', // Steel blue
Regionalism: '#C061CB', // Vibrant purple
Repetition: '#00A67C', // Green-cyan
Spelling: '#EE4266', // Pink-red
Style: '#FFD23F', // Yellow
Typo: '#FF6B35', // Vibrant orange-red
+ Usage: '#1E90FF', // Dodger blue
WordChoice: '#228B22', // Forest green
} as const;
diff --git a/packages/web/src/lib/lintKindColor.ts b/packages/web/src/lib/lintKindColor.ts
index e8d3f1ab3..2c0cbda60 100644
--- a/packages/web/src/lib/lintKindColor.ts
+++ b/packages/web/src/lib/lintKindColor.ts
@@ -1,17 +1,24 @@
// First, define the color map as a constant
const LINT_KIND_COLORS = {
Agreement: '#228B22', // Forest green
+ BoundaryError: '#8B4513', // Saddle brown
Capitalization: '#540D6E', // Deep purple
+ Eggcorn: '#FF8C00', // Dark orange
Enhancement: '#0EAD69', // Green
Formatting: '#7D3C98', // Amethyst purple
+ Grammar: '#9B59B6', // Medium purple
+ Malapropism: '#C71585', // Medium violet red
Miscellaneous: '#3BCEAC', // Turquoise
+ Nonstandard: '#008B8B', // Dark cyan
Punctuation: '#D4850F', // Dark orange
Readability: '#2E8B57', // Sea green
+ Redundancy: '#4682B4', // Steel blue
Regionalism: '#C061CB', // Vibrant purple
Repetition: '#00A67C', // Green-cyan
Spelling: '#EE4266', // Pink-red
Style: '#FFD23F', // Yellow
Typo: '#FF6B35', // Vibrant orange-red
+ Usage: '#1E90FF', // Dodger blue
WordChoice: '#228B22', // Forest green
} as const;