From 1b0643299866d9ab805be1932565c36c4dfc3c06 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 9 Feb 2023 17:29:31 +0100 Subject: [PATCH] ci: add a check that a 'state' key does exist for every app in the catalog --- catalog_linter.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/catalog_linter.py b/catalog_linter.py index 6e17117..3265989 100644 --- a/catalog_linter.py +++ b/catalog_linter.py @@ -1,10 +1,18 @@ import toml import sys +errors = [] + 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"} categories = toml.load(open('categories.toml')).keys() + def check_apps(): for app, infos in catalog.items(): @@ -19,7 +27,8 @@ def check_apps(): if category not in categories: yield f"{app}: category {category} is not defined in categories.toml" -errors = list(check_apps()) + +errors = errors + list(check_apps()) for error in errors: print(error)