Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clichés #1356

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
165 changes: 165 additions & 0 deletions proselint/checks/cliches/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,3 +851,168 @@ def check_cliches_gnu_diction(text):
]

return existence_check(text, list, err, msg, join=True, ignore_case=True)


@memoize
def check_cliches_nigel(text):
"""Check the text.

source: Nigel Ree's Dictionary of Cliches
source_url: bit.ly/3sL091j
"""
err = "cliches.nigel"
msg = "'{}' is cliché."

cliches = [
"abhors a vacuum",
"accident waiting to happen",
"Achilles' heel",
"acquired taste",
"active consideration",
"added bonus",
"agenda-setting",
"agonizing reappraisal",
"alive and well",
"all-time low",
"ample opportunity",
"and now, if you'll excuse me",
"as every schoolboy knows",
"as night follows day",
"as surely as night follows day",
"at daggers drawn",
"at this moment in time",
"at this point in time",
"auspicious occasion",
"back to basics",
"baptism of fire",
"bare necessities",
"bears eloquent testimony",
"beggars all description",
"best-kept secret",
"birth pangs",
"bitter experience",
"blazing inferno",
"brave new world",
"breathing space",
"brought to a satisfactory conclusion",
"caring and sharing",
"case of the tail wagging the dog",
"categorical denial",
"caught up in a sinister web",
"caught up in a sinister plot",
"chequered career",
"chicken and egg situation",
"close proximity",
"closely knit community",
"common decency",
"competitive edge",
"concerted effort",
"concrete jungle",
"cream of the crop",
"crowd pleaser",
"cruellest month",
"crumbling edifice",
"crushing blow",
"crux of the matter",
"crux of the case",
"crux of the problem",
"daunting prospect",
"deafening silence",
"death knell",
"defining moment",
"deserving of serious consideration",
"dire straits",
"dizzy heights",
"down memory lane",
"draconian powers",
"drastic measures",
"dream turned to nightmare",
"dulcet tones",
"earth shattering",
"echo these fears",
"elder statesman",
"end of civilization as we know it",
"existing conditions",
"exposed to the ravages",
"fair sex",
"fate worse than death",
"flights of fancy",
"fly on the wall",
"foregone conclusion",
"further ado",
"gentle sex",
"gone but not forgotten",
"greatly to be desired",
"hair's breadth",
"hand in glove",
"having said that",
"heads must roll",
"heads will roll",
"heady mixture",
"heart of gold",
"hearts of gold",
"heinous crime",
"honeymoon is over for",
"hotly contested",
"humble abode",
"ill-gotten gains",
"illustrious dead",
"in a very real sense",
"in no uncertain terms",
"in the cold light of day",
"in the land of the living",
"in the lap of luxury",
"in this day and age",
"it was a dark and stormy night",
"it was going to be a long night",
"it was just like a fairy tale",
"just deserts",
"killer instinct",
"land of the living",
"light at the end of the tunnel",
"like a dream come true",
"like a fish out of water",
"long hot summer",
"major setback",
"man behind the myth",
"merciful release",
"miles of golden sand",
"nail into the coffin",
"needs no introduction",
"nipped in the bud",
"no pun intended",
"not a pretty sight",
"of paramount importance",
"of which more anon",
"only time will tell",
"rash act",
"ravages of time",
"redeeming feature",
"redeeming features",
"rest is history",
"rooted objection",
"rough old trade",
"rude awakening",
"select few",
"seminal classic",
"seminal work",
"sick and tired",
"sight for sore eyes",
"silent majority",
"sorely missed",
"speculation was rife",
"spending spree",
"thrown into the melting-pot",
"time immemorial",
"tragedy struck when",
"unbridled passion",
"unimpeachable authority",
"usual suspects",
"when all is said and done",
"when the chips are down",
"wind of change",
"yawning gap",

]

return existence_check(text, cliches, err, msg, join=True, ignore_case=True)
10 changes: 10 additions & 0 deletions tests/test_cliches.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def setUp(self):
self.l_garner = """Worse than a fate worse than death."""
self.l_write_good = """He's a chip off the old block."""
self.l_gnu_diction = """It's a matter of concern."""
self.l_nigel = """He's sick and tired of it."""

def test_cliches_garner_basic(self):
"""Basic checks on check_cliches_garner."""
Expand All @@ -43,3 +44,12 @@ def test_cliches_gnu_diction_basic(self):
assert chk.check_cliches_gnu_diction(self.l_gnu_diction) != []
assert "cliches.gnu_diction" in chk.check_cliches_gnu_diction(
self.l_gnu_diction)[0]

def test_cliches_nigel_basic(self):
"""Basic check on check_cliches_nigel."""
assert chk.check_cliches_nigel("""No cliches here.""") == []
# use one of the example cliches to verify basic functionality
assert chk.check_cliches_nigel(self.l_nigel) != []
assert "cliches.nigel" in chk.check_cliches_nigel(
self.l_nigel)[0]