Skip to content

Commit

Permalink
Do not crash if job does not contain rules
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinFairise2 committed Sep 25, 2024
1 parent cdc6b1f commit a38fc84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ def contains_valid_change_rule(rule):
tests_without_change_path = defaultdict(list)
tests_without_change_path_allowed = defaultdict(list)
for test, filepath in tests:
if not any(contains_valid_change_rule(rule) for rule in config[test]['rules'] if isinstance(rule, dict)):
if "rules" in config[test] and not any(
contains_valid_change_rule(rule) for rule in config[test]['rules'] if isinstance(rule, dict)
):
if test in tests_without_change_path_allow_list:
tests_without_change_path_allowed[filepath].append(test)
else:
Expand Down

0 comments on commit a38fc84

Please sign in to comment.