report_parser: Fixed a minor report formatting bug
This patch addresses an issue of the report getting mangled, when
the cppcheck/checkpach outpult file contains invalid data. The
new behavior is that such lines will be reported but not fail the
report generation.
Change-Id: I70fcd16985dd9f92ae0ff9b70d6535828262571c
Signed-off-by: Galanakis, Minos <minos.galanakis@linaro.org>
diff --git a/report_parser/report_parser.py b/report_parser/report_parser.py
index 3642744..6acd7f5 100644
--- a/report_parser/report_parser.py
+++ b/report_parser/report_parser.py
@@ -237,7 +237,12 @@
for en in checkpath_entries:
_file, _line, _ = en[0].split(":")
- _type, _subtype, _ = en[1].split(":")
+ try:
+ _type, _subtype, _ = en[1].split(":")
+ except Exception as e:
+ print("WARNING: Ignoring Malformed checkpatch line: %s" %
+ "".join(en))
+ continue
_msg = en[2]
out_data["_metadata_"] = {"errors": _errors,