[ovs-dev] [PATCH 3/6] checkpatch: print the final warning / error count
Aaron Conole
aconole at redhat.com
Fri Oct 7 20:17:54 UTC 2016
Because we track it, might as well report it.
Signed-off-by: Aaron Conole <aconole at redhat.com>
---
utilities/checkpatch.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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:
--
2.7.4
More information about the dev
mailing list