mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-04 02:58:10 +10:00
@@ -0,0 +1,10 @@
|
||||
import json
|
||||
|
||||
categories = ["blacklist", "appdaemon", "integration", "netdaemon", "plugin", "python_script", "theme"]
|
||||
|
||||
for category in categories:
|
||||
with open(category, "r") as cat_file:
|
||||
content = json.loads(cat_file.read())
|
||||
if content != sorted(content, key=str.casefold):
|
||||
print(f"{category} is not sorted correctly")
|
||||
exit(1)
|
||||
@@ -0,0 +1,11 @@
|
||||
import json
|
||||
|
||||
categories = ["blacklist", "appdaemon", "integration", "netdaemon", "plugin", "python_script", "theme"]
|
||||
|
||||
for category in categories:
|
||||
with open(category, "r") as cat_file:
|
||||
content = json.loads(cat_file.read())
|
||||
|
||||
with open(category, "w") as cat_file:
|
||||
cat_file.write(json.dumps(sorted(content, key=str.casefold), indent=2))
|
||||
|
||||
Reference in New Issue
Block a user