summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaresh G Solanki <naresh.solanki@intel.com>2018-06-20 14:53:57 +0530
committerPatrick Georgi <pgeorgi@google.com>2018-06-25 08:19:37 +0000
commitfb7eaa5beb41edeceb81b36aeb78dfe8aa1aa8dd (patch)
treef20eb86de29b7d2f6bb718f4181ed341187fbc4d
parent04d2601426b0633bc817e57f44e087098bab2f84 (diff)
downloadcoreboot-fb7eaa5beb41edeceb81b36aeb78dfe8aa1aa8dd.tar.xz
util/lint/checkpatch_json: Fix checkpatch output keyword match string
From checkpatch output, look for keywords starting with 'ERROR:' & 'WARNING:' . Also check for keywork ': FILE:' instead of the same without the colon (:). BUG=None BRANCH=None TEST=Check if patch https://review.coreboot.org/#/c/coreboot/+/22537/21 is processed & json output is generated properly. Change-Id: Ib690ab34a1ffabc4f83642634fd34beea16a64dc Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com> Reviewed-on: https://review.coreboot.org/27170 Reviewed-by: Rizwan Qureshi <rizwan.qureshi@intel.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rwxr-xr-xutil/lint/checkpatch_json.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/lint/checkpatch_json.py b/util/lint/checkpatch_json.py
index 3254aae03b..44b2a8b887 100755
--- a/util/lint/checkpatch_json.py
+++ b/util/lint/checkpatch_json.py
@@ -38,11 +38,11 @@ def update_struct( file_path, msg_output, line_number):
def parse_file(input_file):
fp = open (input_file, "r")
for line in fp:
- if "ERROR" in line:
+ if line.startswith("ERROR:"):
msg_output = line.split("ERROR:")[1].strip()
- elif "WARNING" in line:
+ elif line.startswith("WARNING:"):
msg_output = line.split("WARNING:")[1].strip()
- elif "FILE" in line:
+ elif ": FILE:" in line:
temp = line.split("FILE:")
file_path = temp[1].split(":")[0]
line_number = temp[1].split(":")[1]