From d335eb9779b1924938ae4b29ad8b14d2882aeb35 Mon Sep 17 00:00:00 2001 From: Vincent Riesop Date: Tue, 19 Dec 2023 09:38:16 +0100 Subject: [PATCH] fix: add check if referenced feature does exist (#40) 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