summaryrefslogtreecommitdiff
path: root/usr/src/tools/scripts/git-pbchk.py
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2014-07-14 20:10:37 -0700
committerGarrett D'Amore <garrett@damore.org>2014-07-21 09:20:34 -0700
commit95c635efb7c3b86efc493e0447eaec7aecca3f0f (patch)
tree3c62b5521fea39ab7bab299052b02576ae802db9 /usr/src/tools/scripts/git-pbchk.py
parent81d43577d1b5e76e6016ba642ecc1a76fde43021 (diff)
downloadillumos-gate-95c635efb7c3b86efc493e0447eaec7aecca3f0f.tar.gz
5025 import and use mandoc
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Albert Lee <trisk@nexenta.com> Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/tools/scripts/git-pbchk.py')
-rw-r--r--usr/src/tools/scripts/git-pbchk.py15
1 files changed, 14 insertions, 1 deletions
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 <garrett@damore.org>
#
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)