Skip to content

Commit 37125d5

Browse files
authored
Merge branch 'amperser:main' into fix/misc-but
2 parents d98bd47 + 616e855 commit 37125d5

23 files changed

+350
-298
lines changed

proselint/checks/cliches/hell.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
1515
"""
1616

17-
from proselint.registry.checks import Check, CheckFlags, types
17+
from proselint.registry.checks import Check, types
1818

1919
check = Check(
2020
check_type=types.ExistenceSimple(pattern="all hell broke loose"),
2121
path="cliches.hell",
2222
message="Never use the phrase 'all hell broke loose'.",
23-
flags=CheckFlags(results_limit=1),
2423
)
2524

2625
__register__ = (check,)

proselint/checks/misc/capitalization.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
check_terms = Check(
2020
check_type=types.PreferredFormsSimple(
2121
items={
22-
"stone age": "Stone Age",
22+
"mother nature": "Mother Nature",
2323
"Space Age": "space age",
24+
"stone age": "Stone Age",
2425
"the American west": "the American West",
25-
"mother nature": "Mother Nature",
2626
}
2727
),
2828
path="misc.capitalization.terms",
@@ -34,8 +34,8 @@
3434
check_type=types.PreferredFormsSimple(
3535
items={
3636
"Winter": "winter",
37-
# "Fall": "fall",
3837
"Summer": "summer",
38+
# "Fall": "fall",
3939
# "Spring": "spring",
4040
}
4141
),
@@ -49,16 +49,16 @@
4949
items={
5050
"january": "January",
5151
"february": "February",
52-
# "march": "March",
5352
"april": "April",
54-
# "may": "May",
5553
"june": "June",
5654
"july": "July",
5755
"august": "August",
5856
"september": "September",
5957
"october": "October",
6058
"november": "November",
6159
"december": "December",
60+
# "march": "March",
61+
# "may": "May",
6262
}
6363
),
6464
path="misc.capitalization.months",

proselint/checks/misc/institution_name.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
check = Check(
2424
check_type=types.PreferredFormsSimple(
2525
items={
26-
"Virginia Polytechnic and State University": (
26+
"virginia polytechnic and state university": (
2727
"Virginia Polytechnic Institute and State University"
2828
),
2929
}

proselint/checks/misc/phrasal_adjectives.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@
3737
"criminal law professor": "criminal-law professor",
3838
"cut and dried issue": "cut-and-dried issue",
3939
"downward sloping line": "downward-sloping line",
40-
"English language learners": "English-language learners",
41-
"English speaking people": "English-speaking people",
40+
"english language learners": "English-language learners",
41+
"english speaking people": "English-speaking people",
4242
"even numbered": "even-numbered",
4343
"fact to face meeting": "face-to-face meeting",
4444
"fixed rate mortgage": "fixed-rate mortgage",
4545
"for profit firm": "for-profit firm",
4646
"foreign sounding name": "foreign-sounding name",
47+
"free range chicken": "free-range chicken",
48+
"free range poultry": "free-range poultry",
4749
"government owned business": "government-owned business",
4850
"hard and fast issue": "hard-and-fast issue",
4951
"head on collision": "head-on collision",
@@ -52,15 +54,16 @@
5254
"heath care coverage": "health-care coverage",
5355
"high school student": "high-school student",
5456
"hit and run statute": "hit-and-run statute",
55-
"HIV negative person": "HIV-negative person",
56-
"HIV positive person": "HIV-positive person",
57+
"hiv negative person": "HIV-negative person",
58+
"hiv positive person": "HIV-positive person",
5759
"information technology personnel": (
5860
"information-technology personnel"
5961
),
6062
"intellectual property rights": "intellectual-property rights",
6163
"interest group pressures": "interest-group pressures",
6264
"joint stock company": "joint-stock company",
6365
"kidney dialysis machine": "kidney-dialysis machine",
66+
"larger than life personality": "larger-than-life personality",
6467
"long run costs": "long-run costs",
6568
"long term care": "long-term care",
6669
"low income housing": "low-income housing",
@@ -71,6 +74,9 @@
7174
"no fault accident": "no-fault accident",
7275
"no fault divorce": "no-fault divorce",
7376
"no fault insurance": "no-fault insurance",
77+
"non profit making organization": "non-profit-making organization",
78+
"non profit-making organization": "non-profit-making organization",
79+
"non-profit making organization": "non-profit-making organization",
7480
"odd numbered": "odd-numbered",
7581
"office supply store": "office-supply store",
7682
"one way flight": "one-way flight",
@@ -87,7 +93,6 @@
8793
"razor sharp intellect": "razor-sharp intellect",
8894
"razor sharp mind": "razor-sharp mind",
8995
"razor sharp wit": "razor-sharp wit",
90-
"larger than life personality": "larger-than-life personality",
9196
"real estate prices": "real-estate prices",
9297
"real estate tycoon": "real-estate tycoon",
9398
"right wing militia": "right-wing militia",
@@ -96,42 +101,37 @@
96101
"second largest army": "second-largest army",
97102
"shell shocked mothers": "shell-shocked mothers",
98103
"shell shocked soldiers": "shell-shocked soldiers",
104+
"small animal veterinarian": "small-animal veterinarian",
99105
"small business loan": "small-business loan",
100106
"small business owner": "small-business owner",
101107
"small state senator": "small-state senator",
102-
"small animal veterinarian": "small-animal veterinarian",
108+
"stained glass ceiling": "stained-glass ceiling",
109+
"stained glass window": "stained-glass window",
103110
"state sponsored terrorism": "state-sponsored terrorism",
104111
"state sponsored violence": "state-sponsored violence",
105112
"thumbs up sign": "thumbs-up sign",
106113
"time honored tradition": "time-honored tradition",
107-
r"U\.S\. led campaign": r"U\.S\.-led campaign",
108114
"upward sloping line": "upward-sloping line",
109115
"venture backed company": "venture-backed company",
110116
"well publicized event": "well-publicized event",
111117
"wire transfer service": "wire-transfer service",
112118
"yes or no question": "yes-or-no question",
113119
"zero sum game": "zero-sum game",
114-
"stained glass ceiling": "stained-glass ceiling",
115-
"stained glass window": "stained-glass window",
116-
"free range chicken": "free-range chicken",
117-
"free range poultry": "free-range poultry",
118-
"non profit making organization": "non-profit-making organization",
119-
"non-profit making organization": "non-profit-making organization",
120-
"non profit-making organization": "non-profit-making organization",
120+
r"u\.s\. led campaign": r"U\.S\.-led campaign",
121121
# Harmony
122122
"three part harmony": "three-part harmony",
123123
"four part harmony": "four-part harmony",
124124
"six part harmony": "six-part harmony",
125125
"eight part harmony": "eight-part harmony",
126126
# Losses and gains.
127-
"first quarter loss": "first-quarter loss",
128-
"second quarter loss": "second-quarter loss",
129-
"third quarter loss": "third-quarter loss",
130-
"fourth quarter loss": "fourth-quarter loss",
131127
"first quarter gain": "first-quarter gain",
128+
"first quarter loss": "first-quarter loss",
132129
"second quarter gain": "second-quarter gain",
130+
"second quarter loss": "second-quarter loss",
133131
"third quarter gain": "third-quarter gain",
132+
"third quarter loss": "third-quarter loss",
134133
"fourth quarter gain": "fourth-quarter gain",
134+
"fourth quarter loss": "fourth-quarter loss",
135135
}
136136
),
137137
path="misc.phrasal_adjectives.examples",

proselint/checks/misc/preferred_forms.py

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,50 @@
1414
1515
"""
1616

17-
from proselint.registry.checks import Check, types
17+
from proselint.registry.checks import Check, Padding, types
18+
19+
CHECK_PATH = "misc.preferred_forms"
20+
CHECK_MESSAGE = "'{}' is the preferred form."
1821

1922
check = Check(
2023
check_type=types.PreferredFormsSimple(
2124
items={
2225
# Obsolete words
2326
"imprimature": "imprimatur",
2427
# Proper nouns
25-
"haloween": "Halloween",
2628
"hallowe'en": "Halloween",
27-
"Khruschev": "Khrushchev",
28-
"Kruschev": "Khrushchev",
29-
"Klu Klux Klan": "Ku Klux Klan",
30-
"Pontius Pilot": "Pontius Pilate",
29+
"haloween": "Halloween",
30+
"khruschev": "Khrushchev",
31+
"klu klux klan": "Ku Klux Klan",
32+
"kruschev": "Khrushchev",
33+
"pontius pilot": "Pontius Pilate",
3134
# Plurals
3235
"hippopotami": "hippopotamuses",
36+
"longstanding": "long-standing",
3337
"manifesti": "manifestos",
3438
"matrixes": "matrices",
3539
"mongeese": "mongooses",
3640
"narcissuses": "narcissi",
41+
"non-sequitur": "non sequitur",
3742
"retinae": "retinas",
38-
"soprani": "sopranos",
39-
"titmouses": "titmice",
40-
# Hyphenated words
41-
"longstanding": "long-standing",
4243
"sans-serif": "sans serif",
4344
"sanserif": "sans serif",
45+
"soprani": "sopranos",
46+
"titmouses": "titmice",
4447
"tort feasor": "tortfeasor",
4548
"tort-feasor": "tortfeasor",
46-
"tranship": "transship",
4749
"trans-ship": "transship",
48-
"transhipped": "transshiped",
4950
"trans-shipped": "transshipped",
50-
"transhipping": "transshipping",
5151
"trans-shipping": "transshipping",
52-
"non-sequitur": "non sequitur",
52+
"tranship": "transship",
53+
"transhipped": "transshiped",
54+
"transhipping": "transshipping",
5355
# Misc
5456
"mental attitude": "attitude",
55-
"Chief Justice of the United States Supreme Court": (
57+
"chief justice of the united states supreme court": (
5658
"Chief Justice of the United States"
5759
),
58-
"Chief Justice of the Supreme Court of the United States": (
60+
"chief justice of the supreme court of the united states": (
5961
"Chief Justice of the United States"
6062
),
6163
"chitlings": "chitterlings",
@@ -122,11 +124,10 @@
122124
"in the meanwhile": "in the meantime",
123125
"lengthy distances": "long distances",
124126
"maddening crowd": "madding crowd",
125-
"Magna Charta": "Magna Carta",
127+
"magna charta": "Magna Carta",
126128
"mariage de convenance": "marriage of convenience",
127-
"Meantime,": "Meanwhile,",
128-
"Middle West": "Midwest",
129-
"Middle Western": "Midwestern",
129+
"middle west": "Midwest",
130+
"middle western": "Midwestern",
130131
"modes of operandi": "modi operandi",
131132
"mode of operandi": "modus operandi",
132133
"notion seconded": "motion seconded",
@@ -144,8 +145,8 @@
144145
"both of the last": "the last two",
145146
"inorganic food": "unorganic food",
146147
"veil of tears": "vale of tears",
147-
"Venus's flytrap": "Venus flytrap",
148-
"Venus' flytrap": "Venus flytrap",
148+
"venus's flytrap": "Venus flytrap",
149+
"venus' flytrap": "Venus flytrap",
149150
"was accused with": "was accused of",
150151
# Verbosity
151152
"make an attempt to": "try to",
@@ -177,4 +178,23 @@
177178
message="'{}' is the preferred form.",
178179
)
179180

180-
__register__ = (check,)
181+
check_meantime_capital = Check(
182+
check_type=types.PreferredForms(items={
183+
r"\bMeantime,\B": "Meanwhile,",
184+
}, padding=Padding.RAW),
185+
path=CHECK_PATH,
186+
message=CHECK_MESSAGE,
187+
ignore_case=False,
188+
)
189+
190+
check_meantime_clause = Check(
191+
check_type=types.PreferredForms(items={
192+
r"\b[;,] meantime,\B": "meanwhile,"
193+
}, padding=Padding.RAW),
194+
path=CHECK_PATH,
195+
message=CHECK_MESSAGE,
196+
ignore_case=False,
197+
offset=(2, 0),
198+
)
199+
200+
__register__ = (check, check_meantime_capital, check_meantime_clause)

proselint/checks/misc/pretension.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
"""
1616

17-
from proselint.registry.checks import Check, CheckFlags, types
17+
from proselint.registry.checks import Check, types
1818

1919
check = Check(
2020
check_type=types.Existence(
@@ -27,7 +27,6 @@
2727
),
2828
path="misc.pretension",
2929
message="Jargon words like '{}' are the hallmarks of a pretentious ass.",
30-
flags=CheckFlags(results_limit=1),
3130
)
3231

3332
__register__ = (check,)

proselint/checks/misc/suddenly.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@
2727
2828
"""
2929

30-
from proselint.registry.checks import Check, CheckFlags, types
30+
from proselint.registry.checks import Check, types
3131

3232
check = Check(
3333
check_type=types.ExistenceSimple(pattern="Suddenly,"),
3434
path="misc.suddenly",
3535
message="Suddenly is nondescript, slows the action, and warns your reader.",
36-
flags=CheckFlags(results_limit=3),
3736
ignore_case=False,
3837
)
3938

proselint/checks/mixed_metaphors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Mixed metaphors."""
22

3-
from proselint.registry.checks import Check, CheckFlags, types
3+
from proselint.registry.checks import Check, types
44

55
"""
66
source: Sir Ernest Gowers
@@ -20,7 +20,6 @@
2020
),
2121
path="mixed_metaphors.bottleneck",
2222
message="Mixed metaphor — bottles with big necks are easy to pass through.",
23-
flags=CheckFlags(results_limit=1),
2423
)
2524

2625
"""

proselint/checks/mondegreens.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
"attorney and not a republic": "attorney and notary public",
2525
"beckon call": "beck and call",
2626
"for all intensive purposes": "for all intents and purposes",
27-
"Lady Mondegreen": "laid him on the green",
28-
"Olive, the other reindeer": "all of the other reindeer",
27+
"lady mondegreen": "laid him on the green",
28+
"olive, the other reindeer": "all of the other reindeer",
2929
"to the manor born": "to the manner born",
3030
}
3131
),
3232
path="mondegreens",
3333
message="'{}' is the preferred form.",
34-
)
34+
)
3535

3636
__register__ = (check,)

proselint/checks/needless-variants

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ unrevokable,irrevocable
197197
judgmatic,judgmental
198198
gerry-rigged,jury-rigged
199199
jerry-rigged,jury-rigged
200-
Coffee klatsch,kaffeeklatsch
200+
coffee klatsch,kaffeeklatsch
201201
coffee klatch,kaffeeklatsch
202202
nicknack,knickknack
203203
labyrinthian,labyrinthine
@@ -358,4 +358,4 @@ vociferant,vociferous
358358
volitive,volitional
359359
wolvish,wolfish
360360
wolverene,wolverine
361-
Zoroastrism,Zoroastrianism
361+
zoroastrism,Zoroastrianism

0 commit comments

Comments
 (0)