Skip to content

Commit

Permalink
fix: add check if referenced feature does exist
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vincinator committed Oct 26, 2023
1 parent 002a2ff commit 7917622
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builder/parse_features
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7917622

Please sign in to comment.