@@ -1129,6 +1129,12 @@ pub fn lint_group() -> LintGroup {
1129
1129
"A more vivid adjective would better convey intense hunger." ,
1130
1130
"Encourages vivid writing by suggesting `starving` instead of weaker expressions like `very hungry.`"
1131
1131
) ,
1132
+ "LastDitch" => (
1133
+ [ "last ditch" , "last ditched" , "last-ditched" ] ,
1134
+ [ "last-ditch" ] ,
1135
+ "In this idiom, `ditch` is a noun and a hyphen is needed." ,
1136
+ "Corrects wrong variations of the idiomatic adjective `last-ditch`."
1137
+ ) ,
1132
1138
"InvestIn" => (
1133
1139
[ "invest into" ] ,
1134
1140
[ "invest in" ] ,
@@ -2402,6 +2408,15 @@ mod tests {
2402
2408
) ;
2403
2409
}
2404
2410
2411
+ #[ test]
2412
+ fn correct_last_ditched ( ) {
2413
+ assert_suggestion_result (
2414
+ "I was actually just trying that as a last ditched attempt to get it working, previously those ..." ,
2415
+ lint_group ( ) ,
2416
+ "I was actually just trying that as a last-ditch attempt to get it working, previously those ..." ,
2417
+ ) ;
2418
+ }
2419
+
2405
2420
#[ test]
2406
2421
fn corrects_invested_into ( ) {
2407
2422
assert_suggestion_result (
@@ -2411,6 +2426,15 @@ mod tests {
2411
2426
) ;
2412
2427
}
2413
2428
2429
+ #[ test]
2430
+ fn correct_last_ditch_space ( ) {
2431
+ assert_suggestion_result (
2432
+ "There are unique use cases and is meant to be a last ditch option." ,
2433
+ lint_group ( ) ,
2434
+ "There are unique use cases and is meant to be a last-ditch option." ,
2435
+ ) ;
2436
+ }
2437
+
2414
2438
#[ test]
2415
2439
fn corrects_invest_into ( ) {
2416
2440
assert_suggestion_result (
0 commit comments