blob: 77dba501439148f2399edd73cc087b577b6b73a6 [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=(",", ": "))
)