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>
This commit is contained in:
parent
04d2601426
commit
fb7eaa5beb
|
@ -38,11 +38,11 @@ def update_struct( file_path, msg_output, line_number):
|
||||||
def parse_file(input_file):
|
def parse_file(input_file):
|
||||||
fp = open (input_file, "r")
|
fp = open (input_file, "r")
|
||||||
for line in fp:
|
for line in fp:
|
||||||
if "ERROR" in line:
|
if line.startswith("ERROR:"):
|
||||||
msg_output = line.split("ERROR:")[1].strip()
|
msg_output = line.split("ERROR:")[1].strip()
|
||||||
elif "WARNING" in line:
|
elif line.startswith("WARNING:"):
|
||||||
msg_output = line.split("WARNING:")[1].strip()
|
msg_output = line.split("WARNING:")[1].strip()
|
||||||
elif "FILE" in line:
|
elif ": FILE:" in line:
|
||||||
temp = line.split("FILE:")
|
temp = line.split("FILE:")
|
||||||
file_path = temp[1].split(":")[0]
|
file_path = temp[1].split(":")[0]
|
||||||
line_number = temp[1].split(":")[1]
|
line_number = temp[1].split(":")[1]
|
||||||
|
|
Loading…
Reference in New Issue