From fb7eaa5beb41edeceb81b36aeb78dfe8aa1aa8dd Mon Sep 17 00:00:00 2001 From: Naresh G Solanki Date: Wed, 20 Jun 2018 14:53:57 +0530 Subject: 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 Reviewed-on: https://review.coreboot.org/27170 Reviewed-by: Rizwan Qureshi Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- util/lint/checkpatch_json.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util/lint') 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] -- cgit v1.2.3