diff mbox

[ovs-dev,3/6] checkpatch: print the final warning / error count

Message ID 1475871477-11608-4-git-send-email-aconole@redhat.com
State Changes Requested
Headers show

Commit Message

Aaron Conole Oct. 7, 2016, 8:17 p.m. UTC
Because we track it, might as well report it.

Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 utilities/checkpatch.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index ed53f32..61678a9 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -247,6 +247,7 @@  def usage():
 
 
 def ovs_checkpatch_file(filename):
+    global __warnings, __errors
     try:
         mail = email.message_from_file(open(filename, 'r'))
     except:
@@ -256,7 +257,10 @@  def ovs_checkpatch_file(filename):
     for part in mail.walk():
         if part.get_content_maintype() == 'multipart':
             continue
-        return ovs_checkpatch_parse(part.get_payload(decode=True))
+    result = ovs_checkpatch_parse(part.get_payload(decode=True))
+    if result < 0:
+        print("Warnings: %d, Errors: %d" % (__warnings, __errors))
+    return result
 
 if __name__ == '__main__':
     try: