From c312675054f814323274257270df07a08f463eed Mon Sep 17 00:00:00 2001 From: Jordan Suchow Date: Mon, 21 Mar 2016 06:11:23 -0400 Subject: [PATCH] Rename typography module #373 --- README.md | 2 +- plugins/vim/readme.md | 2 +- proselint/.proselintrc | 2 +- proselint/checks/butterick/__init__.py | 1 - proselint/checks/typography/__init__.py | 1 + .../{butterick => typography}/symbols.py | 26 +++++++------------ site/_posts/2014-06-10-checks.md | 2 +- 7 files changed, 14 insertions(+), 22 deletions(-) delete mode 100644 proselint/checks/butterick/__init__.py create mode 100644 proselint/checks/typography/__init__.py rename proselint/checks/{butterick => typography}/symbols.py (85%) diff --git a/README.md b/README.md index 149be853f..2b913f4b8 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,6 @@ You can disable any of the checks by modifying `.proselintrc`. | ID | Description | | ----- | --------------- | -| `butterick.symbols` | Using the right symbol | | `carlin.filth` | Words to avoid | | `consistency.spacing` | Consistent sentence spacing | | `consistency.spelling` | Consistent use of British vs. American spelling | @@ -154,6 +153,7 @@ You can disable any of the checks by modifying `.proselintrc`. | `strunk_white.composition` | Avoiding wordy phrases | | `strunk_white.greylist` | Words to avoid | | `strunk_white.usage` | Misc. usage recommendations | +| `typography.symbols` | Using the right symbol | | `twain.damn` | Avoiding the word "very" | | `wallace.tense_present` | Misc. advice | | `wallace.uncomparables` | Not comparing uncomparables | diff --git a/plugins/vim/readme.md b/plugins/vim/readme.md index 8f0692241..f8687235f 100644 --- a/plugins/vim/readme.md +++ b/plugins/vim/readme.md @@ -26,7 +26,7 @@ certain Proselint rules, add the IDs of the relevant rules to ```vim let g:syntastic_text_proselint_quiet_messages = { \ 'regex': [ - \ '\m^butterick\.', + \ '\m^typography\.', \ '\m^twain\.damn\>', \ ] } ``` diff --git a/proselint/.proselintrc b/proselint/.proselintrc index a4cbcc3c5..91d252b4f 100644 --- a/proselint/.proselintrc +++ b/proselint/.proselintrc @@ -1,7 +1,6 @@ { "max_errors": 1000, "checks": { - "butterick.symbols" : true, "carlin.filth" : true, "consistency.spacing" : true, "consistency.spelling" : true, @@ -67,6 +66,7 @@ "strunk_white.composition" : true, "strunk_white.greylist" : true, "strunk_white.usage" : true, + "typography.symbols" : true, "wallace.redundancy" : true, "wallace.tense_present" : true, "wallace.uncomparables" : true, diff --git a/proselint/checks/butterick/__init__.py b/proselint/checks/butterick/__init__.py deleted file mode 100644 index 2aa8c9979..000000000 --- a/proselint/checks/butterick/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Advice from Butterick's Practical Typography.""" diff --git a/proselint/checks/typography/__init__.py b/proselint/checks/typography/__init__.py new file mode 100644 index 000000000..0adff64f5 --- /dev/null +++ b/proselint/checks/typography/__init__.py @@ -0,0 +1 @@ +"""Advice on typography.""" diff --git a/proselint/checks/butterick/symbols.py b/proselint/checks/typography/symbols.py similarity index 85% rename from proselint/checks/butterick/symbols.py rename to proselint/checks/typography/symbols.py index 3db4b1293..c10b7a6bb 100644 --- a/proselint/checks/butterick/symbols.py +++ b/proselint/checks/typography/symbols.py @@ -1,25 +1,17 @@ # -*- coding: utf-8 -*- -"""Use the symbols. +"""Use the right symbols. ---- -layout: post source: Butterick's Practical Typography source_url: http://practicaltypography.com/ -title: Tense present -date: 2014-06-10 12:31:19 -categories: writing ---- - -Use the symbols. - """ + from proselint.tools import memoize, existence_check, preferred_forms_check @memoize def check_ellipsis(text): """Use an ellipsis instead of three dots.""" - err = "butterick.symbols.ellipsis" + err = "typography.symbols.ellipsis" msg = u"'...' is an approximation, use the ellipsis symbol '…'." regex = "\.\.\." @@ -30,7 +22,7 @@ def check_ellipsis(text): @memoize def check_copyright_symbol(text): """Use the copyright symbol instead of (c).""" - err = "butterick.symbols.copyright" + err = "typography.symbols.copyright" msg = u"(c) is a goofy alphabetic approximation, use the symbol ©." regex = "\([cC]\)" @@ -41,7 +33,7 @@ def check_copyright_symbol(text): @memoize def check_trademark_symbol(text): """Use the trademark symbol instead of (TM).""" - err = "butterick.symbols.trademark" + err = "typography.symbols.trademark" msg = u"(TM) is a goofy alphabetic approximation, use the symbol ™." regex = "\(TM\)" @@ -52,7 +44,7 @@ def check_trademark_symbol(text): @memoize def check_registered_trademark_symbol(text): """Use the registered trademark symbol instead of (R).""" - err = "butterick.symbols.trademark" + err = "typography.symbols.trademark" msg = u"(R) is a goofy alphabetic approximation, use the symbol ®." regex = "\([rR]\)" @@ -63,7 +55,7 @@ def check_registered_trademark_symbol(text): @memoize def check_sentence_spacing(text): """Use no more than two spaces after a period.""" - err = "butterick.symbols.sentence_spacing" + err = "typography.symbols.sentence_spacing" msg = u"More than two spaces after the period; use 1 or 2." regex = "\. {3}" @@ -74,7 +66,7 @@ def check_sentence_spacing(text): @memoize def check_multiplication_symbol(text): u"""Use the multiplication symbol ×, not the lowercase letter x.""" - err = "butterick.symbols.multiplication_symbol" + err = "typography.symbols.multiplication_symbol" msg = u"Use the multiplication symbol ×, not the letter x." regex = "[0-9]+ ?x ?[0-9]+" @@ -85,7 +77,7 @@ def check_multiplication_symbol(text): @memoize def check_curly_quotes(text): u"""Use curly quotes, not straight quotes.""" - err = "butterick.symbols.curly_quotes" + err = "typography.symbols.curly_quotes" msg = u'Use curly quotes “”, not straight quotes "".' list = [ diff --git a/site/_posts/2014-06-10-checks.md b/site/_posts/2014-06-10-checks.md index e19608d26..e7050a3b9 100644 --- a/site/_posts/2014-06-10-checks.md +++ b/site/_posts/2014-06-10-checks.md @@ -10,7 +10,6 @@ Here is a list of what proselint checks. | ID | Description | | ----- | --------------- | -| `butterick.symbols` | Using the right symbol | | `carlin.filth` | Words to avoid | | `consistency.spacing` | Consistent sentence spacing | | `consistency.spelling` | Consistent use of British vs. American spelling | @@ -67,6 +66,7 @@ Here is a list of what proselint checks. | `strunk_white.composition` | Avoiding wordy phrases | | `strunk_white.greylist` | Words to avoid | | `strunk_white.usage` | Misc. usage recommendations | +| `typography.symbols` | Using the right symbol | | `wallace.tense_present` | Misc. advice | | `wallace.uncomparables` | Not comparing uncomparables | | `white.damn` | Avoiding the word "very" |