Print this page
manpage lint.

*** 15,24 **** --- 15,25 ---- # # # 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,56 **** # 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 class GitError(Exception): pass --- 47,57 ---- # 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, ManLint, Mapfile class GitError(Exception): pass
*** 280,289 **** --- 281,300 ---- 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,330 **** --- 332,342 ---- cmds = [copyright, cstyle, hdrchk, jstyle, keywords, + manlint, mapfilechk] run_checks(root, parent, cmds, paths) def pbchk(root, parent, paths):
*** 332,341 **** --- 344,354 ---- copyright, cstyle, hdrchk, jstyle, keywords, + manlint, mapfilechk] run_checks(root, parent, cmds) def main(cmd, args):