Output json without trailing whitespaces but with trailing newlines.
Makes them more editor friendly, primarily when copied into system/linkerconfig/testdata/root. Test: m Test: No diff between apex_manifest_full.json in out/ and in linkerconfig/testdata/root/ Bug: 140599044 Change-Id: I6dacdd4baa59e6d70586c4a6343b9b8fd1b574f6
This commit is contained in:
parent
efbce1cace
commit
37fa32ce94
1 changed files with 3 additions and 2 deletions
|
@ -112,9 +112,10 @@ def main():
|
|||
|
||||
if args.out:
|
||||
with open(args.out, "w") as f:
|
||||
json.dump(obj, f, indent=2)
|
||||
json.dump(obj, f, indent=2, separators=(',', ': '))
|
||||
f.write('\n')
|
||||
else:
|
||||
print(json.dumps(obj, indent=2))
|
||||
print(json.dumps(obj, indent=2, separators=(',', ': ')))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in a new issue