From 79176228451ccca58ff964c10687946499c32ce7 Mon Sep 17 00:00:00 2001 From: Vincent Riesop Date: Thu, 26 Oct 2023 13:52:14 +0200 Subject: [PATCH] fix: add check if referenced feature does exist fixes #22 If a feature references a non existing featute, then the builder should exit with an error message telling the user that this feature does not exist. --- builder/parse_features | 1 + 1 file changed, 1 insertion(+) diff --git a/builder/parse_features b/builder/parse_features index 7d32e1d..861ac3f 100755 --- a/builder/parse_features +++ b/builder/parse_features @@ -168,6 +168,7 @@ def read_feature_files(feature_dir): if attr not in [ "include", "exclude" ]: continue for ref in node_features[attr]: + assert os.path.isfile(f"{feature_dir}/{ref}/info.yaml"), f"feature {node} references feature {ref}, but {feature_dir}/{ref}/info.yaml does not exist" feature_graph.add_edge(node, ref, attr=attr) assert networkx.is_directed_acyclic_graph(feature_graph) return feature_graph