summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2012-10-17 21:43:18 -0700
committerJohn Koleszar <jkoleszar@google.com>2012-10-17 21:43:29 -0700
commit13d69d40da1637ec821b13b5105baf85d1638c11 (patch)
tree00c55530570924b329e7b90e07da4044b14e24e9 /tools
parent2b6fd28dfe881a08d36d492f2e00189da5e7d4d6 (diff)
downloadlibvpx-13d69d40da1637ec821b13b5105baf85d1638c11.tar.gz
libvpx-13d69d40da1637ec821b13b5105baf85d1638c11.tar.bz2
libvpx-13d69d40da1637ec821b13b5105baf85d1638c11.zip
lint-hunks: exit status for only affected lines
Prior to this patch, if there were any lint errors, this script would exit with an error, even if those errors were not in the hunks being tested by this script. This change makes it so that if any lint lines are printed, an error is returned. Change-Id: I69c8bef4367ccf25d287508f29e587b1f4426143
Diffstat (limited to 'tools')
-rwxr-xr-xtools/lint-hunks.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/lint-hunks.py b/tools/lint-hunks.py
index c14caecce..312fab138 100755
--- a/tools/lint-hunks.py
+++ b/tools/lint-hunks.py
@@ -111,8 +111,6 @@ def main(argv=None):
lint = Subprocess(cpplint_cmd, expected_returncode=(0, 1),
stdin=show.stdout, stderr=subprocess.PIPE)
lint_out = lint.communicate()[1]
- if lint.returncode == 1:
- lint_failed = True
for line in lint_out.split("\n"):
fields = line.split(":")
@@ -122,8 +120,9 @@ def main(argv=None):
if warning_line_num in affected_lines:
print "%s:%d:%s"%(filename, warning_line_num,
":".join(fields[2:]))
+ lint_failed = True
- # Propagate lint's exit status
+ # Set exit code if any relevant lint errors seen
if lint_failed:
return 1