mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
add json check before compile (#354)
* add json check before compile * do more checking on effects * add effects checking * better effects checking. * integrate schema check for default config reduce size of default configs
This commit is contained in:
23
test/jsonchecks/checkjson.py
Normal file
23
test/jsonchecks/checkjson.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
import json, sys
|
||||
|
||||
print("-- validate json files")
|
||||
|
||||
retval = 0
|
||||
total = 0
|
||||
errors = 0
|
||||
for filename in sys.argv[1:]:
|
||||
with open(filename) as f:
|
||||
total += 1
|
||||
msg = " check json %s ... " % filename
|
||||
try:
|
||||
json.load(f)
|
||||
#print(msg + "ok")
|
||||
except ValueError as e:
|
||||
print(msg + 'invalid')
|
||||
retval = 1
|
||||
errors += 1
|
||||
|
||||
print(" checked files: %s success: %s errors: %s" % (total,(total-errors),errors))
|
||||
|
||||
sys.exit(retval)
|
Reference in New Issue
Block a user