Debian Codegraph @

proselint/checks/consistency/spacing.py

raw
1 """Mixed one vs. two spaces after a period.
2
3 ---
4 layout: post
5 source: Consistency.
6 source_url: ???
7 title: Mixed use of 1 vs. 2 spaces after a period.
8 date: 2014-06-10 12:31:19
9 categories: writing
10 ---
11
12 Points out instances where there are two conventions, 1 vs. 2 spaces after
13 a period, in the same document.
14
15 """
16 from proselint.tools import consistency_check, memoize
17
18
19 @memoize
20 def check(text):
21 """Check the text."""
22 err = "consistency.spacing"
23 msg = "Inconsistent spacing after period (1 vs. 2 spaces)."
24
25 regex = [r"[\.\?!] [A-Z]", r"[\.\?!] [A-Z]"]
26 return consistency_check(text, [regex], err, msg)