docchecker: scan for missing space before :hg:
authortimeless <timeless@mozdev.org>
Wed, 06 Jan 2016 20:05:18 +0000
changeset 27733 3d1baa702d1a
parent 27732 ea3937af2bb1
child 27734 5c0fd878779c
docchecker: scan for missing space before :hg:
doc/docchecker
tests/test-gendoc.t
--- a/doc/docchecker	Wed Jan 06 19:57:29 2016 +0000
+++ b/doc/docchecker	Wed Jan 06 20:05:18 2016 +0000
@@ -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) = ('', '')
--- a/tests/test-gendoc.t	Wed Jan 06 19:57:29 2016 +0000
+++ b/tests/test-gendoc.t	Wed Jan 06 20:05:18 2016 +0000
@@ -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