mirror of
https://github.com/Automattic/harper.git
synced 2025-08-04 18:48:02 +00:00
feat: last ditched/ditch→last-ditch (#1147)
* feat: last ditched/ditch→last-ditch * fix: unit test names didn't quite match tests --------- Co-authored-by: Elijah Potter <me@elijahpotter.dev>
This commit is contained in:
parent
7ce6acda49
commit
aaf7e14dd8
1 changed files with 24 additions and 0 deletions
|
@ -1129,6 +1129,12 @@ pub fn lint_group() -> LintGroup {
|
|||
"A more vivid adjective would better convey intense hunger.",
|
||||
"Encourages vivid writing by suggesting `starving` instead of weaker expressions like `very hungry.`"
|
||||
),
|
||||
"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`."
|
||||
),
|
||||
"InvestIn" => (
|
||||
["invest into"],
|
||||
["invest in"],
|
||||
|
@ -2402,6 +2408,15 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn correct_last_ditched() {
|
||||
assert_suggestion_result(
|
||||
"I was actually just trying that as a last ditched attempt to get it working, previously those ...",
|
||||
lint_group(),
|
||||
"I was actually just trying that as a last-ditch attempt to get it working, previously those ...",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn corrects_invested_into() {
|
||||
assert_suggestion_result(
|
||||
|
@ -2411,6 +2426,15 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn correct_last_ditch_space() {
|
||||
assert_suggestion_result(
|
||||
"There are unique use cases and is meant to be a last ditch option.",
|
||||
lint_group(),
|
||||
"There are unique use cases and is meant to be a last-ditch option.",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn corrects_invest_into() {
|
||||
assert_suggestion_result(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue