[PATCH 5 of 8] docchecker: scan for missing space before :hg:
timeless
timeless at mozdev.org
Tue Jan 12 22:56:29 UTC 2016
# HG changeset patch
# User timeless <timeless at mozdev.org>
# Date 1452110718 0
# Wed Jan 06 20:05:18 2016 +0000
# Node ID b377a23d6d61694be26a4764d08ea7b155bfe866
# Parent 5d86ea2132efaa21272c5293bc24d1aa9b020b79
docchecker: scan for missing space before :hg:
diff --git a/doc/docchecker b/doc/docchecker
--- a/doc/docchecker
+++ b/doc/docchecker
@@ -11,11 +11,15 @@
leadingline = re.compile(r'(^\s*)(\S.*)$')
hg_backtick = re.compile(r""":hg:`[^`]*'[^`]*`""")
+hg_cramped = re.compile(r'\w:hg:`')
def check(line):
if hg_backtick.search(line):
print(line)
print("""warning: please avoid nesting ' in :hg:`...`""")
+ if hg_cramped.search(line):
+ print(line)
+ print('warning: please have a space before :hg:')
def work(file):
(llead, lline) = ('', '')
diff --git a/tests/test-gendoc.t b/tests/test-gendoc.t
--- a/tests/test-gendoc.t
+++ b/tests/test-gendoc.t
@@ -32,6 +32,8 @@
% extracting documentation from de
checking for parse errors
+ Die Dateien werden dem Projektarchiv beim n\xc3\xa4chsten \xc3\x9cbernehmen (commit) hinzugef\xc3\xbcgt. Um dies vorher r\xc3\xbcckg\xc3\xa4ngig zu machen, siehe:hg:`forget`. (esc)
+ warning: please have a space before :hg:
% extracting documentation from el
checking for parse errors
More information about the Mercurial-devel
mailing list