blob: e4f28181cbd287886ec1c41d1fe405448e0b1de7 [file] [log] [blame]
#!/usr/bin/python3
# all arguments to this script are considered as json files
# and attempted to be formatted alphabetically
import json
from sys import argv
for file in argv[1:]:
print("formatting file {}".format(file))
with open(file) as f:
j = json.load(f)
with open(file, 'w') as f:
f.write(json.dumps(j, indent=4, sort_keys=True, separators=(',', ': ')))