Add build step to verify json formatting
This will run autojson during the build to verify
that all files are formatted correctly.
Tested: Before this change build failed, after
fixing json file, it passed
Change-Id: I119cc898536a972bb7a248143b40d695f880ff2f
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/scripts/autojson.py b/scripts/autojson.py
index 582631d..6b14bd5 100755
--- a/scripts/autojson.py
+++ b/scripts/autojson.py
@@ -3,9 +3,18 @@
# and attempted to be formatted alphabetically
import json
+import os
from sys import argv
-for file in argv[1:]:
+files = argv[1:]
+
+for file in files[:]:
+ if os.path.isdir(file):
+ files.remove(file)
+ for f in os.listdir(file):
+ files.append(os.path.join(file, f))
+
+for file in files:
print("formatting file {}".format(file))
with open(file) as f:
j = json.load(f)