1
0
Fork 0

ci: add a check that a 'state' key does exist for every app in the catalog

This commit is contained in:
Alexandre Aubin 2023-02-09 17:29:31 +01:00
parent 98d75b3df9
commit 1b06432998

View file

@ -1,10 +1,18 @@
import toml import toml
import sys import sys
errors = []
catalog = toml.load(open('apps.toml')) catalog = toml.load(open('apps.toml'))
for app, infos in catalog.items():
if "state" not in infos:
errors.append(f"{app}: missing state info")
catalog = {app: infos for app, infos in catalog.items() if infos.get('state') == "working"} catalog = {app: infos for app, infos in catalog.items() if infos.get('state') == "working"}
categories = toml.load(open('categories.toml')).keys() categories = toml.load(open('categories.toml')).keys()
def check_apps(): def check_apps():
for app, infos in catalog.items(): for app, infos in catalog.items():
@ -19,7 +27,8 @@ def check_apps():
if category not in categories: if category not in categories:
yield f"{app}: category {category} is not defined in categories.toml" yield f"{app}: category {category} is not defined in categories.toml"
errors = list(check_apps())
errors = errors + list(check_apps())
for error in errors: for error in errors:
print(error) print(error)