checkpatch_json: Mark robotic comments as robotic
Gerrit now knows to differentiate between "regular" comments and "robot" comments, with some later changes to the UI in the pipeline (e.g. to filter out robot messages) Change-Id: I3a545d1cf6c04b331964becd2b24eb38018394eb Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/51504 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
parent
b97e6f713e
commit
39891c00da
|
@ -19,6 +19,9 @@ def update_struct( file_path, msg_output, line_number):
|
|||
if file_path not in list_temp:
|
||||
list_temp[file_path] = []
|
||||
list_temp[file_path].append({
|
||||
"robot_id" : "checkpatch",
|
||||
"robot_run_id" : sys.argv[3],
|
||||
"url" : sys.argv[4],
|
||||
"line" : line_number,
|
||||
"message" : msg_output,}
|
||||
)
|
||||
|
@ -40,14 +43,14 @@ def parse_file(input_file):
|
|||
fp.close()
|
||||
|
||||
def main():
|
||||
if (len(sys.argv) < 3) or (sys.argv[1] == "-h"):
|
||||
if (len(sys.argv) < 5) or (sys.argv[1] == "-h"):
|
||||
print("HELP:")
|
||||
print(sys.argv[0] + " <input file> <output file in json>")
|
||||
print(sys.argv[0] + " <input file> <output file in json> <job-id> <job-url>")
|
||||
sys.exit()
|
||||
|
||||
print(sys.argv[1])
|
||||
parse_file(sys.argv[1])
|
||||
data['comments'] = list_temp
|
||||
data['robot_comments'] = list_temp
|
||||
print(json.dumps(data))
|
||||
out_file = open( sys.argv[2] , "w")
|
||||
json.dump(data, out_file, sort_keys=True, indent=4)
|
||||
|
|
Loading…
Reference in New Issue