Files
S.P.L.U.R.T-Station-13/tools/json_verifier.py
Leo 0dc826735b Adds a python script to load jsons to prevent any syntax error on them (#33001)
* Adds a python script to load jsons to prevent any syntax error on them

* Corrects identation on hallucination.json
2017-11-24 12:59:41 -06:00

20 lines
442 B
Python

import sys
import json
if len(sys.argv) <= 1:
exit(1)
files = filter(len, sys.argv[1].split('\n'))
msg = []
for file in files:
with open(file, encoding="ISO-8859-1") as f:
try:
json.load(f)
except ValueError as exception:
msg.append("JSON synxtax error on file: {}".format(file))
msg.append(str(exception))
if msg:
print("\n".join(msg))
exit(1)
exit(0)