Print this page
manpage lint.

@@ -15,10 +15,11 @@
 #
 
 #
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2008, 2012 Richard Lowe
+# Copyright 2014 Garrett D'Amore <garrett@damore.org>
 #
 
 import getopt
 import os
 import re

@@ -46,11 +47,11 @@
 # from the source tree we use the modules also within the source tree.
 #
 sys.path.insert(2, os.path.join(os.path.dirname(__file__), ".."))
 
 from onbld.Checks import Comments, Copyright, CStyle, HdrChk
-from onbld.Checks import JStyle, Keywords, Mapfile
+from onbld.Checks import JStyle, Keywords, ManLint, Mapfile
 
 
 class GitError(Exception):
     pass
 

@@ -280,10 +281,20 @@
         ret |= JStyle.jstyle(fh, output=output, picky=True)
         fh.close()
     return ret
 
 
+def manlint(root, parent, flist, output):
+    ret = 0
+    output.write("Man page format:\n")
+    ManfileRE = re.compile(r'.*\.[0-9][a-z]*$', re.IGNORECASE)
+    for f in flist(lambda x: ManfileRE.match(x)):
+        fh = open(f, 'r')
+        ret |= ManLint.manlint(fh, output=output, picky=True)
+        fh.close()
+    return ret
+
 def keywords(root, parent, flist, output):
     ret = 0
     output.write("SCCS Keywords:\n")
     for f in flist():
         fh = open(f, 'r')

@@ -321,10 +332,11 @@
     cmds = [copyright,
             cstyle,
             hdrchk,
             jstyle,
             keywords,
+            manlint,
             mapfilechk]
     run_checks(root, parent, cmds, paths)
 
 
 def pbchk(root, parent, paths):

@@ -332,10 +344,11 @@
             copyright,
             cstyle,
             hdrchk,
             jstyle,
             keywords,
+            manlint,
             mapfilechk]
     run_checks(root, parent, cmds)
 
 
 def main(cmd, args):