From 95c635efb7c3b86efc493e0447eaec7aecca3f0f Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 14 Jul 2014 20:10:37 -0700 Subject: 5025 import and use mandoc Reviewed by: Hans Rosenfeld Reviewed by: Igor Kozhukhov Reviewed by: Robert Mustacchi Reviewed by: Albert Lee Approved by: Dan McDonald --- usr/src/tools/scripts/git-pbchk.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'usr/src/tools/scripts/git-pbchk.py') diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index 656e22f6b4..55d80d8f3f 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -17,6 +17,7 @@ # # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2008, 2012 Richard Lowe +# Copyright 2014 Garrett D'Amore # import getopt @@ -48,7 +49,7 @@ sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib", 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): @@ -282,6 +283,16 @@ def jstyle(root, parent, flist, output): 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") @@ -323,6 +334,7 @@ def nits(root, parent, paths): hdrchk, jstyle, keywords, + manlint, mapfilechk] run_checks(root, parent, cmds, paths) @@ -334,6 +346,7 @@ def pbchk(root, parent, paths): hdrchk, jstyle, keywords, + manlint, mapfilechk] run_checks(root, parent, cmds) -- cgit v1.2.3