Skip to content

Commit

Permalink
fix: guard lookups into DEFAULT_TOOL_LABELS (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle authored Mar 13, 2024
1 parent 452edf8 commit d77295e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions format/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ def format_multirun(name, **kwargs):
lang_attribute = to_attribute_name(lang)

# Logic:
# - if there's no value for this key, the user omitted it, so use our default
# - if there's no value for this key, the user omitted it, so use our default if we have one
# - if there is a value, and it's False, then skip this language
# (and make sure we don't eagerly reference @multitool in case it isn't defined)
# - otherwise use the user-supplied value
tool_label = False
if lang_attribute in kwargs.keys():
tool_label = kwargs.pop(lang_attribute)
else:
elif lang in DEFAULT_TOOL_LABELS.keys():
tool_label = Label(DEFAULT_TOOL_LABELS[lang])
if not tool_label:
continue
Expand Down

0 comments on commit d77295e

Please sign in to comment.