diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2020-06-12 14:38:29 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-06-18 08:30:47 +0000 |
commit | 57ead8935674f1c487f9a5b347231b37d6650805 (patch) | |
tree | 0d7900a11e4219e004ea70d62eae60f6fabfc371 /util/lint/checkpatch_json.py | |
parent | 447472ec540babec8650938d2f21959885b9e53c (diff) | |
download | coreboot-57ead8935674f1c487f9a5b347231b37d6650805.tar.xz |
lint: convert checkpatch_json.py to python 3
Align all coreboot scripts on one python version.
Tested by running the original suggested test:
$ nice -n 20 git diff HEAD~ | util/lint/checkpatch.pl \
--no-signoff -q - | tee checkpatch.txt
$ util/lint/checkpatch_json.py checkpatch.txt \
comment.json checkpatch.txt
Change-Id: Iec2bb0be23b27a3eaf92f293c962a8e6bfb03af0
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42318
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'util/lint/checkpatch_json.py')
-rwxr-xr-x | util/lint/checkpatch_json.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/lint/checkpatch_json.py b/util/lint/checkpatch_json.py index 7da213c7d0..8102c114b9 100755 --- a/util/lint/checkpatch_json.py +++ b/util/lint/checkpatch_json.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0-only """ @@ -41,14 +41,14 @@ def parse_file(input_file): def main(): if (len(sys.argv) < 3) or (sys.argv[1] == "-h"): - print "HELP:" - print sys.argv[0] + " <input file> <output file in json>" + print("HELP:") + print(sys.argv[0] + " <input file> <output file in json>") sys.exit() - print sys.argv[1] + print(sys.argv[1]) parse_file(sys.argv[1]) data['comments'] = list_temp - print json.dumps(data) + print(json.dumps(data)) out_file = open( sys.argv[2] , "w") json.dump(data, out_file, sort_keys=True, indent=4) out_file.close() |