Skip to content

Commit

Permalink
Raise an error when unrecognised tags are specified.
Browse files Browse the repository at this point in the history
  • Loading branch information
JSKenyon committed Apr 22, 2024
1 parent b8bda2f commit dd44be8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stimela/kitchen/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ def process_specifier_list(specs: List[str], num=0):
# process our own entries - the parent recipe has None key.
tags, skip_tags, step_ranges, skip_ranges, enable_steps = subrecipe_entries.get(None, ([],[],[],[],[]))

# Check that all specified tags (if any), exist.
known_tags = set.union(*([v.tags for v in self.steps.values()] or [set()]))
assert len(set(tags) - known_tags) == 0, f"Unrecognised tag(s) specified in -t/--tags: {tags}."
assert len(set(skip_tags) - known_tags) == 0, f"Unrecognised tag(s) specified in --skip-tags: {skip_tags}."

# We have to handle the following functionality:
# - user specifies specific tag(s) to run
# - user specifies specific tag(s) to skip
Expand Down

0 comments on commit dd44be8

Please sign in to comment.