diff options
author | Gordon Ross <gordon.w.ross@gmail.com> | 2018-04-14 14:01:02 -0400 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2018-05-03 01:03:02 -0400 |
commit | 4ff15898b7da74f6c007b0fef82a27cb866afade (patch) | |
tree | bc813a56caed9972826a6eca130f918ed3e78fe8 /usr/src/tools/scripts/git-pbchk.py | |
parent | 6578fdfad83f727b6fd5f68d4e8985b2760e0d80 (diff) | |
download | illumos-joyent-4ff15898b7da74f6c007b0fef82a27cb866afade.tar.gz |
9473 Want git nits to check for white space nits
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.net>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/tools/scripts/git-pbchk.py')
-rw-r--r-- | usr/src/tools/scripts/git-pbchk.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index d8a3e19bf3..4a3533156d 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -48,7 +48,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.Scm import Ignore -from onbld.Checks import Comments, Copyright, CStyle, HdrChk +from onbld.Checks import Comments, Copyright, CStyle, HdrChk, WsCheck from onbld.Checks import JStyle, Keywords, ManLint, Mapfile, SpellCheck @@ -122,7 +122,7 @@ def git_parent_branch(branch): if not branch: return None - p = git(["for-each-ref", "--format=%(refname:short) %(upstream:short)", + p = git(["for-each-ref", "--format=%(refname:short) %(upstream:short)", "refs/heads/"]) if not p: @@ -310,6 +310,14 @@ def keywords(root, parent, flist, output): fh.close() return ret +def wscheck(root, parent, flist, output): + ret = 0 + output.write("white space nits:\n") + for f in flist(): + fh = open(f, 'r') + ret |= WsCheck.wscheck(fh, output=output) + fh.close() + return ret def run_checks(root, parent, cmds, paths='', opts={}): """Run the checks given in 'cmds', expected to have well-known signatures, @@ -343,7 +351,8 @@ def nits(root, parent, paths): jstyle, keywords, manlint, - mapfilechk] + mapfilechk, + wscheck] run_checks(root, parent, cmds, paths) @@ -355,7 +364,8 @@ def pbchk(root, parent, paths): jstyle, keywords, manlint, - mapfilechk] + mapfilechk, + wscheck] run_checks(root, parent, cmds) |