Skip to content
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions harper-core/src/linting/phrase_corrections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,20 @@ pub fn lint_group() -> LintGroup {
"Corrects the slip `I've go to` to the idiomatic `I've got to`.",
LintKind::Typo
),
"JackOLantern" => (
["jack o lantern", "jackolantern", "jack-o-lantern"],
["jack-o'-lantern", "jack o'lantern"],
"Use contraction when referring to `jack-o'-lantern`",
"Corrects contraction of `jack o lantern` to `jack o'lantern` or `jack-o'-lantern`",
LintKind::Punctuation
),
"JackOLanterns" => (
["jack o lanterns", "jackolanterns", "jack-o-lanterns"],
["jack-o'-lanterns", "jack o'lanterns"],
"Use contraction when referring to `jack-o'-lanterns`",
"Corrects contraction of `jack o lanterns` to `jack o'lanterns` or `jack-o'-lanterns`",
LintKind::Punctuation
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I only just realized. In phrase_corrections like this will create two settings that have to be enabled/disabled individually. One for the singular and one for the plural. If you move them to the newer phrase_set_corrections you can put them both together with just a single setting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's super neat! I'll also have to update my previous rule(#1829) to that new correction style as well.

"JawDropping" => (
["jar-dropping"],
["jaw-dropping"],
Expand Down Expand Up @@ -766,6 +780,13 @@ pub fn lint_group() -> LintGroup {
"Corrects non-standard variants of `low-hanging fruit`.",
LintKind::Usage
),
"LoAndBehold" => (
["low and behold"],
["lo and behold"],
"The correct form is `lo and behold`.",
"Corrects non-standard variant of `lo and behold`.",
LintKind::Malapropism
),
"ManagerialReins" => (
["managerial reigns"],
["managerial reins"],
Expand Down
Loading