forked from Automattic/harper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphrase_corrections.rs
1828 lines (1707 loc) · 66.8 KB
/
phrase_corrections.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
use super::{LintGroup, MapPhraseLinter};
/// Produce a [`LintGroup`] that looks for errors in common phrases.
/// Comes pre-configured with the recommended default settings.
pub fn lint_group() -> LintGroup {
let mut group = LintGroup::default();
macro_rules! add_exact_mappings {
($group:expr, {
$($name:expr => ($input:expr, $corrections:expr, $hint:expr, $description:expr)),+ $(,)?
}) => {
$(
$group.add_pattern_linter(
$name,
Box::new(
MapPhraseLinter::new_exact_phrases(
$input,
$corrections,
$hint,
$description
),
),
);
)+
};
}
add_exact_mappings!(group, {
// The name of the rule
"ChangeTack" => (
// The exact phrase(s) to look for.
["change tact", "change tacks", "change tacts"],
// The corrections to provide.
["change tack"],
// The message to be shown with the error.
"Did you mean `change tack`? This idiom is commonly used to indicate a change in direction or approach.",
// A description of the rule.
"Locates errors in the idiom `to change tack` to convey the correct meaning of altering one's course or strategy."
),
"ChangedTack" => (
["changed tact", "changed tacks", "changed tacts"],
["changed tack"],
"Did you mean `changed tack`? This idiom is commonly used to indicate a change in direction or approach.",
"Locates errors in the idiom `to change tack` to convey the correct meaning of altering one's course or strategy."
),
"ChangesTack" => (
["changes tact", "changes tacks", "changes tacts"],
["changes tack"],
"Did you mean `changes tack`? This idiom is commonly used to indicate a change in direction or approach.",
"Locates errors in the idiom `to change tack` to convey the correct meaning of altering one's course or strategy."
),
"ChangingTack" => (
["changing tact", "changing tacks", "changing tacts"],
["changing tack"],
"Did you mean `changing tack`? This idiom is commonly used to indicate a change in direction or approach.",
"Locates errors in the idiom `to change tack` to convey the correct meaning of altering one's course or strategy."
),
"ChangeOfTack" => (
["change of tact", "change of tacks", "change of tacts"],
["change of tack"],
"Did you mean `change of tack`? This idiom is commonly used to indicate a change in direction or approach.",
"Locates errors in the idiom `change of tack` to convey the correct meaning of an alternative course or strategy."
),
"ChangesOfTack" => (
["changes of tact", "changes of tacks", "changes of tacts"],
["changes of tack"],
"Did you mean `changes of tack`? This idiom is commonly used to indicate changes in direction or approach.",
"Locates errors in the idiom `change of tack` to convey the correct meaning of an alternative course or strategy."
),
"ChangingOfTack" => (
["changing of tact", "changing of tacks", "changing of tacts"],
["changing of tack"],
"Did you mean `changing of tack`? This idiom is commonly used to indicate a change in direction or approach.",
"Locates errors in the idiom `to change of tack` to convey the correct meaning of altering one's course or strategy."
),
"WantBe" => (
["want be"],
["won't be", "want to be"],
"Did you mean `won't be` or `want to be`?",
"Detects incorrect usage of `want be` and suggests `won't be` or `want to be` based on context."
),
"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."
),
"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`."
),
"EludedTo" => (
["eluded to"],
["alluded to"],
"Did you mean `alluded to`?",
"Corrects `eluded to` to `alluded to` in contexts referring to indirect references."
),
"BaitedBreath" => (
["baited breath"],
["bated breath"],
"Did you mean `bated breath`?",
"Ensures `bated breath` is written correctly, as `baited breath` is incorrect."
),
"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`."
),
"MutePoint" => (
["mute point"],
["moot point"],
"Did you mean `moot point`?",
"Ensures `moot point` is used instead of `mute point`, as `moot` means debatable or irrelevant."
),
"RoadMap" => (
["roadmap"],
["road map"],
"Did you mean `road map`?",
"Detects when `roadmap` is used instead of `road map`, prompting the correct spacing."
),
"SameAs" => (
["same then"],
["same as"],
"Did you mean `same as`?",
"Corrects the incorrect phrase `same then` to the standard `same as`."
),
"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."
),
"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."
),
"FatalOutcome" => (
["fatal outcome"],
["death"],
"Consider using `death` for clarity.",
"Replaces `fatal outcome` with the more direct term `death` for conciseness."
),
"NotTo" => (
["no to"],
["not to"],
"Did you mean `not to`?",
"Corrects `no to` to `not to`, ensuring proper negation."
),
"ThatThis" => (
["the this"],
["that this"],
"Did you mean `that this`?",
"Fixes `the this` to the correct phrase `that this`."
),
"CondenseAllThe" => (
["all of the"],
["all the"],
"Consider simplifying to `all the`.",
"Suggests removing `of` in `all of the` for a more concise phrase."
),
"AvoidAndAlso" => (
["and also"],
["and"],
"Consider using just `and`.",
"Reduces redundancy by replacing `and also` with `and`."
),
"AndIn" => (
["an in"],
["and in"],
"Did you mean `and in`?",
"Fixes the incorrect phrase `an in` to `and in` for proper conjunction usage."
),
"BeenThere" => (
["bee there"],
["been there"],
"Did you mean `been there`?",
"Corrects the misspelling `bee there` to the proper phrase `been there`."
),
"CanBeSeen" => (
["can be seem"],
["can be seen"],
"Did you mean `can be seen`?",
"Corrects `can be seem` to the proper phrase `can be seen`."
),
"GoingTo" => (
["gong to"],
["going to"],
"Did you mean `going to`?",
"Corrects `gong to` to the intended phrase `going to`."
),
"IAm" => (
["I a m"],
["I am"],
"Did you mean `I am`?",
"Fixes the incorrect spacing in `I a m` to properly form `I am`."
),
"ItCan" => (
["It cam"],
["It can"],
"Did you mean `It can`?",
"Corrects the misspelling `It cam` to the proper phrase `It can`."
),
"MyHouse" => (
["mu house"],
["my house"],
"Did you mean `my house`?",
"Fixes the typo `mu house` to `my house`."
),
"OperativeSystem" => (
["operative system"],
["operating system"],
"Did you mean `operating system`?",
"Ensures `operating system` is used correctly instead of `operative system`."
),
"OperativeSystems" => (
["operative systems"],
["operating systems"],
"Did you mean `operating systems`?",
"Ensures `operating systems` is used correctly instead of `operative systems`."
),
"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."
),
"WaveFunction" => (
["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."
),
"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."
),
"WillContain" => (
["will contains"],
["will contain"],
"Did you mean `will contain`?",
"Incorrect verb form: `will` should be followed by the base form `contain`."
),
"IsKnownFor" => (
["is know for"],
["is known for"],
"Did you mean `is known for`?",
"Typo: `known` is the correct past participle."
),
"PointIsMoot" => (
["your point is mute"],
["your point is moot"],
"Did you mean `your point is moot`?",
"Typo: `moot` (meaning debatable) is correct rather than `mute`."
),
"ByAccident" => (
["on accident"],
["by accident"],
"Did you mean `by accident`?",
"Incorrect preposition: `by accident` is the idiomatic expression."
),
"ThatChallenged" => (
["the challenged"],
["that challenged"],
"Did you mean `that challenged`?",
"Changes `the challenged` to `that challenged` to fix the misspelling."
),
"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`."
),
"HumanLife" => (
["human live"],
["human life"],
"Did you mean `human life`?",
"Changes `human live` to `human life`."
),
"NeedHelp" => (
["ned help"],
["need help"],
"Did you mean `need help`?",
"Changes `ned help` to the correct `need help`."
),
"AndTheLike" => (
["an the like"],
["and the like"],
"Did you mean `and the like`?",
"Fixes the typo in `and the like`."
),
"BatedBreath" => (
["baited breath"],
["bated breath"],
"Did you mean `bated breath`?",
"Changes `baited breath` to the correct `bated breath`."
),
"BeckAndCall" => (
["back and call"],
["beck and call"],
"Did you mean `beck and call`?",
"Fixes `back and call` to `beck and call`."
),
"LetAlone" => (
["let along"],
["let alone"],
"Did you mean `let alone`?",
"Changes `let along` to `let alone`."
),
"SneakingSuspicion" => (
["sneaky suspicion"],
["sneaking suspicion"],
"Did you mean `sneaking suspicion`?",
"Changes `sneaky suspicion` to `sneaking suspicion`."
),
"SpecialAttention" => (
["spacial attention"],
["special attention"],
"Did you mean `special attention`?",
"Changes `spacial attention` to `special attention`."
),
"SupposedTo" => (
["suppose to"],
["supposed to"],
"Did you mean `supposed to`?",
"Fixes `suppose to` to the correct `supposed to`."
),
"KindRegards" => (
["kid regards"],
["kind regards"],
"Did you mean `kind regards`?",
"Changes `kid regards` to `kind regards`."
),
"ThoughtProcess" => (
["though process"],
["thought process"],
"Did you mean `thought process`?",
"Changes `though process` to `thought process`."
),
"BadRap" => (
["bed rap", "bad rep"],
["bad rap"],
"Did you mean `bad rap`?",
"Changes `bed rap` to the proper idiom `bad rap`."
),
"OfCourse" => (
["off course", "o course"],
["Of course"],
"Did you mean `of course`?",
"Detects the non‐idiomatic phrase `off course` and suggests the correct form `of course`."
),
"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."
),
"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`."
),
"HungerPang" => (
["hunger pain"],
["hunger pang"],
"Did you mean `hunger pang`?",
"Corrects `hunger pain` to `hunger pang`."
),
"GetRidOff" => (
["get rid off", "get ride of", "get ride off"],
["get rid of"],
"Did you mean `get rid of`?",
"Ensures `get rid of` is used instead of `get rid off`."
),
"GetsRidOff" => (
["gets rid off", "gets ride of", "gets ride off"],
["gets rid of"],
"Did you mean `gets rid of`?",
"Ensures `gets rid of` is used instead of `gets rid off`."
),
"GettingRidOff" => (
["getting rid off", "getting ride of", "getting ride off"],
["getting rid of"],
"Did you mean `getting rid of`?",
"Ensures `getting rid of` is used instead of `getting rid off`."
),
"GotRidOff" => (
["got rid off", "got ride of", "got ride off"],
["got rid of"],
"Did you mean `got rid of`?",
"Ensures `got rid of` is used instead of `got rid off`."
),
"GottenRidOff" => (
["gotten rid off", "gotten ride of", "gotten ride off"],
["gotten rid of"],
"Did you mean `gotten rid of`?",
"Ensures `gotten rid of` is used instead of `gotten rid off`."
),
"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`."
),
"BlanketStatement" => (
["blanketed statement"],
["blanket statement"],
"Use the more idiomatic phrasing.",
"Corrects common errors in the phrase `blanket statement`."
),
"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`."
),
"TakeItSeriously" => (
["take it serious"],
["take it seriously"],
"Did you mean `take it seriously`?",
"Ensures the correct use of the adverb `seriously` instead of the adjective `serious` in phrases like `take it seriously`."
),
"PiggyBag" => (
["piggy bag"],
["piggyback"],
"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."
),
"PiggyBagging" => (
["piggy bagging"],
["piggybacking"],
"Did you mean `piggybacking`?",
"Corrects the eggcorn `piggy bagging` to `piggybacking`, the proper verb form for riding on someone’s back or leveraging an existing system."
),
"PiggyBagged" => (
["piggy bagged"],
["piggybacked"],
"Did you mean `piggybacked`?",
"Corrects the eggcorn `piggy bagged` to `piggybacked`, the proper past tense form for riding on someone’s back or making use of an existing system."
),
"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."
),
"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."
),
"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."
),
"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."
),
"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."
),
"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."
),
"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."
),
"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."
),
"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."
),
"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."
),
"OnTheSpurOfTheMoment" => (
["on the spurt 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 confusion with the incorrect `spurt` variation."
),
"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."
),
"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."
),
"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."
),
"ScantilyClad" => (
["scandally clad"],
["scantily clad"],
"Use the correct phrase for minimal attire.",
"Fixes `scandally clad` to `scantily clad`, ensuring clarity in describing minimal attire."
),
"ToTheMannerBorn" => (
["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."
),
"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."
),
"CaseSensitive" => (
["case sensitive"],
["case-sensitive"],
"Use the hyphenated form for `case-sensitive`.",
"Ensures `case-sensitive` is correctly hyphenated."
),
"ChockFull" => (
["chock full"],
["chock-full"],
"Use the hyphenated form for `chock-full`.",
"Ensures `chock-full` is correctly hyphenated."
),
"OffTheCuff" => (
["off the cuff"],
["off-the-cuff"],
"Use the hyphenated form for `off-the-cuff`.",
"Ensures `off-the-cuff` is correctly hyphenated."
),
"WellBeing" => (
["wellbeing"],
["well-being"],
"Use the hyphenated form for `well-being`.",
"Ensures `well-being` is correctly hyphenated."
),
"SimpleGrammatical" => (
["simply grammatical"],
["simple grammatical"],
"Use `simple grammatical` for correct adjective usage.",
"Corrects `simply grammatical` to `simple grammatical` for proper adjective usage."
),
"ThatChallenged" => (
["the challenged"],
["that challenged"],
"Use `that challenged` for correct relative clause.",
"Corrects `the challenged` to `that challenged` for proper relative clause usage."
),
"ToDoHyphen" => (
["todo"],
["to-do"],
"Hyphenate `to-do`.",
"Ensures `to-do` is correctly hyphenated."
),
"Discuss" => (
["discuss about"],
["discuss"],
"`About` is redundant",
"Removes unnecessary `about` after `discuss`."
),
"Discussed" => (
["discussed about"],
["discussed"],
"Use `discussed` without `about`.",
"Removes unnecessary `about` after `discussed`."
),
"Discusses" => (
["discusses about"],
["discusses"],
"`About` is redundant",
"Removes unnecessary `about` after `discusses`."
),
"Discussing" => (
["discussing about"],
["discussing"],
"`About` is redundant",
"Removes unnecessary `about` after `discussing`."
),
"WorldWarII" => (
["world war 2", "world war ii", "world war ii", "world war ii", "world war ii"],
["World War II"],
"Use the correct capitalization for `World War II`.",
"Ensures `World War II` is correctly capitalized."
),
"Towards" => (
["to towards"],
["towards"],
"Use `towards` without the preceding `to`.",
"Removes redundant `to` before `towards`."
),
"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."
),
"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."
),
"GuineaBissau" => (
// Note: this lint matches any case but cannot correct wrong case
// Note: It can only correct the hyphenation
// Note: See linting/matcher.rs for case corrections
// Note: $input must already be the correct case
// Note: do not add other case variants here
["Guinea Bissau"],
["Guinea-Bissau"],
"The official spelling is hyphenated.",
"Checks for the correct official name of the African country."
),
"PortAuPrince" => (
// Note: this lint matches any case but cannot correct wrong case
// Note: It can only correct the hyphenation
// Note: See linting/matcher.rs for case corrections
// Note: $input must already be the correct case
// Note: do not add other case variants here
["Port au Prince"],
["Port-au-Prince"],
"The official spelling is hyphenated.",
"Checks for the correct official name of the capital of Haiti."
),
"PortoNovo" => (
// Note: this lint matches any case but cannot correct wrong case
// Note: It can only correct the hyphenation
// Note: See linting/matcher.rs for case corrections
// Note: $input must already be the correct case
// Note: do not add other case variants here
["Porto Novo"],
["Porto-Novo"],
"The official spelling is hyphenated.",
"Checks for the correct official name of the capital of Benin."
),
"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`."
),
// Avoid suggestions resulting in "a entire ...."
"AWholeEntire" => (
["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`."
),
"WholeEntire" => (
["whole entire"],
["whole", "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`."
),
"InDetail" => (
["in details"],
["in detail"],
"Use singular `in detail` for referring to a detailed description.",
"Correct unidiomatic plural `in details` to `in detail`."
),
"InMoreDetail" => (
["in more details"],
["in more detail"],
"Use singular `in more detail` for referring to a detailed description.",
"Correct unidiomatic plural `in more details` to `in more detail`."
),
"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."
),
"InAndOfItself" => (
["in of itself"],
["in and of itself"],
"Use `in and of itself` for referring to something's inherent or intrinsic quality.",
"Corrects nonstandard `in of itself` to standard `in and of itself`."
),
"ALotWorst" => (
["a lot worst", "alot worst"],
["a lot worse"],
"Use `worse` for comparing. (`Worst` is for the extreme case)",
"Corrects `a lot worst` to `a lot worse` for proper comparative usage."
),
"FarWorse" => (
["far worst"],
["far worse"],
"Use `worse` for comparing. (`Worst` is for the extreme case)",
"Corrects `far worst` to `far worse` for proper comparative usage."
),
"MuchWorse" => (
["much worst"],
["much worse"],
"Use `worse` for comparing. (`Worst` is for the extreme case)",
"Corrects `much worst` to `much worse` for proper comparative usage."
),
"TurnForTheWorse" => (
["turn for the worst"],
["turn for the worse"],
"Use `turn for the worse` for a negative change in circumstances. Avoid the incorrect `turn for the worst`.",
"Corrects the nonstandard `turn for the worst` to the idiomatic `turn for the worse`, used to describe a situation that has deteriorated."
),
"WorseAndWorse" => (
["worst and worst", "worse and worst", "worst and worse"],
["worse and worse"],
"Use `worse` for comparing. (`Worst` is for the extreme case)",
"Corrects `worst and worst` to `worse and worse` for proper comparative usage."
),
"WorseThan" => (
["worst than"],
["worse than"],
"Use `worse` for comparing. (`Worst` is for the extreme case)",
"Corrects `worst than` to `worse than` for proper comparative usage."
),
"WorstEver" => (
["worse ever"],
["worst ever"],
"Use `worst` for the extreme case. (`Worse` is for comparing)",
"Corrects `worse ever` to `worst ever` for proper comparative 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."
),
"InAnyWay" => (
["in anyway"],
["in any way"],
"Use `in any way` for emphasizing a point.",
"Corrects ungrammatical `in anyway` to `in any way`."
),
"ExplanationMark" => (
["explanation mark"],
["exclamation mark"],
"The correct name for the `!` punctuation is `exclamation mark`.",
"Corrects the eggcorn `explanation mark` to `exclamation mark`."
),
"ExplanationMarks" => (
["explanation marks"],
["exclamation marks"],
"The correct name for the `!` punctuation is `exclamation mark`.",
"Corrects the eggcorn `explanation mark` to `exclamation mark`."
),
"ExplanationPoint" => (
["explanation point"],
["exclamation point"],
"The correct name for the `!` punctuation is `exclamation point`.",
"Corrects the eggcorn `explanation point` to `exclamation point`."
),
"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`."
),
"ALongTime" => (
["along time"],
["a long time"],
"Use `a long time` for referring to a duration of time.",
"Corrects `along time` to `a long time`."
),
"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`."
),
"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."
),
"Intact" => (
["in tact"],
["intact"],
"Use `intact` to mean undamaged or whole.",
"Prevents the erroneous spacing in `in tact`; `intact` is the single correct word."
),
"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`."
),
"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`."
),
"InAWhile" => (
["in awhile", "in while"],
["in a while"],
"When describing a timeframe, use `in a while` for clarity.",
"Corrects the missing article in `in while` or `in awhile`, forming `in a while`."
),
"InQuiteAWhile" => (
["in quite awhile"],
["in quite a while"],
"Add `a` to form `in quite a while`, clarifying the duration.",
"Corrects `in quite awhile` => `in quite a while` by inserting the missing article."
),
"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`."
),
"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`."
),
"AnAnother" => (
["an another", "a another"],
["another"],
"Use `another` on its own.",
"Corrects `an another` and `a another`."
),
"AnotherAn" => (
["another an"],
["another"],
"Use `another` on its own.",
"Corrects `another an` to `another`."
),
"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`."
),
"AnotherThings" => (
["another things"],
["another thing", "other things"],
"`another` is singular but `things` is plural.",
"Corrects `another things`."
),
"TheAnother" => (
["the another"],
["the other", "another"],
"Use `the other` or `another`, not both.",
"Corrects `the another`."
),
"ExpandDependency" => (
["dep"],
["dependency"],
"Use `dependency` instead of `dep`",
"Expands the abbreviation `dep` to the full word `dependency` for clarity."
),
"ExpandDependencies" => (
["deps"],
["dependencies"],
"Use `dependencies` instead of `deps`",
"Expands the abbreviation `deps` to the full word `dependencies` for clarity."
),
"ExpandMinimum" => (
["min"],
["minimum"],
"Use `minimum` instead of `min`",
"Expands the abbreviation `min` to the full word `minimum` for clarity."
),
"ExpandStandardInput" => (
["stdin"],
["standard input"],
"Use `standard input` instead of `stdin`",
"Expands the abbreviation `stdin` to `standard input` for clarity."
),
"ExpandStandardOutput" => (
["stdout"],
["standard output"],
"Use `standard output` instead of `stdout`",
"Expands the abbreviation `stdout` to `standard output` for clarity."
),
"ExpandWith" => (
["w/"],
["with"],
"Use `with` instead of `w/`",
"Expands the abbreviation `w/` to the full word `with` for clarity."
),
"ExpandWithout" => (
["w/o"],
["without"],
"Use `without` instead of `w/o`",
"Expands the abbreviation `w/o` to the full word `without` for clarity."
),
"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."
),
"ExpandBecause" => (
["cuz"],
["because"],
"Use `because` instead of informal `cuz`",
"Expands the informal abbreviation `cuz` to the full word `because` for formality."
),
"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`."
),
"TrialAndError" => (
["trail and error"],
["trial and error"],
"You misspelled `trial`.",
"Corrects `trail` to `trial` in `trial and error`."
),
});
group.set_all_rules_to(Some(true));
group
}
#[cfg(test)]
mod tests {
use crate::linting::tests::{
assert_lint_count, assert_nth_suggestion_result, assert_suggestion_result,
};
use super::lint_group;
#[test]
fn get_rid_off() {
assert_suggestion_result(
"Please bump axios version to get rid off npm warning #624",
lint_group(),
"Please bump axios version to get rid of npm warning #624",
);
}
#[test]
fn gets_rid_off() {
assert_suggestion_result(
"Adding at as a runtime dependency gets rid off that error",
lint_group(),
"Adding at as a runtime dependency gets rid of that error",
);
}
#[test]
fn getting_rid_off() {
assert_suggestion_result(
"getting rid off of all the complexity of the different accesses method of API service providers",
lint_group(),
"getting rid of of all the complexity of the different accesses method of API service providers",
);
}
#[test]
fn got_rid_off() {
assert_suggestion_result(
"For now we got rid off circular deps in model tree structure and it's API.",
lint_group(),
"For now we got rid of circular dependencies in model tree structure and it's API.",
);
}