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
This commit is contained in:
Robin Candau 2025-04-21 20:39:51 +02:00 committed by GitHub
parent 345816f03d
commit 420b7b22db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -146,8 +146,8 @@
"Sha256": "f48a55e9fd4da1b84c2a9e960a9f3bc6e9fa65387ed9181826e1f052b2ce545e" "Sha256": "f48a55e9fd4da1b84c2a9e960a9f3bc6e9fa65387ed9181826e1f052b2ce545e"
} }
} }
], ],
"archlinux": [ "archlinux": [
{ {
"Name": "archlinux", "Name": "archlinux",
"FriendlyName": "Arch Linux", "FriendlyName": "Arch Linux",

View File

@ -3,6 +3,7 @@ import json
import sys import sys
import hashlib import hashlib
import base64 import base64
import difflib
from urllib.request import urlretrieve from urllib.request import urlretrieve
from xml.etree import ElementTree from xml.etree import ElementTree
import tempfile import tempfile
@ -65,7 +66,16 @@ if __name__ == "__main__":
exit(1) exit(1)
with open(sys.argv[1]) as fd: with open(sys.argv[1]) as fd:
content = json.loads(fd.read()) data = fd.read()
content = json.loads(data)
diff = difflib.unified_diff(
data.splitlines(keepends=True),
(json.dumps(content, indent=4) + "\n").splitlines(keepends=True),
fromfile="a" + sys.argv[1],
tofile="b" + sys.argv[1],
)
diff = "".join(diff)
assert diff == "", diff
distros = content['Distributions'] distros = content['Distributions']
assert is_unique([e.get('StoreAppId') for e in distros if e]) assert is_unique([e.get('StoreAppId') for e in distros if e])