Patchwork [5,of,8] docchecker: scan for missing space before :hg:

login
register
mail settings
Submitter timeless@mozdev.org
Date Jan. 12, 2016, 10:56 p.m.
Message ID <b377a23d6d61694be26a.1452639389@waste.org>
Download mbox | patch
Permalink /patch/12733/
State Accepted
Commit 3d1baa702d1a2b38fe13b215c787faf8719adaa4
Headers show

Comments

timeless@mozdev.org - Jan. 12, 2016, 10:56 p.m.
# HG changeset patch
# User timeless <timeless@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:

Patch

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