Fix indentation in DistributionInfo.json (#12838)
* Fix indentation in DistributionInfo.json Replace (accidental) tabs by spaces * Add a json formatting check to the validate.py script This should a coherent formatting for the future
Robin Candau committed
Apr 21, 2025 at 20:39 UTC
420b7b22dba6561619d26e490115e9832a1bf834
2 files changed
+13
-3
distributions/DistributionInfo.json
+2
-2
@@ -146,8 +146,8 @@
146
"Sha256": "f48a55e9fd4da1b84c2a9e960a9f3bc6e9fa65387ed9181826e1f052b2ce545e"
147
}
148
}
149
- ],
150
- "archlinux": [
149
+ ],
150
+ "archlinux": [
151
{
152
"Name": "archlinux",
153
"FriendlyName": "Arch Linux",
distributions/validate.py
+11
-1
@@ -3,6 +3,7 @@ import json
3
import sys
4
import hashlib
5
import base64
6
+import difflib
7
from urllib.request import urlretrieve
8
from xml.etree import ElementTree
9
import tempfile
@@ -65,7 +66,16 @@ if __name__ == "__main__":
66
exit(1)
67
68
with open(sys.argv[1]) as fd:
68
- content = json.loads(fd.read())
69
+ data = fd.read()
70
+ content = json.loads(data)
71
+ diff = difflib.unified_diff(
72
+ data.splitlines(keepends=True),
73
+ (json.dumps(content, indent=4) + "\n").splitlines(keepends=True),
74
+ fromfile="a" + sys.argv[1],
75
+ tofile="b" + sys.argv[1],
76
+ )
77
+ diff = "".join(diff)
78
+ assert diff == "", diff
79
80
distros = content['Distributions']
81
assert is_unique([e.get('StoreAppId') for e in distros if e])