We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4fbf160 commit c570e11Copy full SHA for c570e11
1 file changed
src/macaron/slsa_analyzer/checks/detect_malicious_metadata_check.py
@@ -99,10 +99,14 @@ def _should_skip(
99
Returns True if any result of the dependency heuristic does not match the expected result.
100
Otherwise, returns False.
101
"""
102
+ mapped_h: dict[Heuristics, list[HeuristicResult]] = {}
103
for heuristic, expected_result in depends_on:
- dep_heuristic_result: HeuristicResult = results[heuristic]
104
- if dep_heuristic_result is not expected_result:
105
- return True
+ mapped_h.setdefault(heuristic, []).append(expected_result)
+
106
+ for heuristic, exp_results in mapped_h.items():
107
+ dep_heuristic_result = results.get(heuristic)
108
+ if dep_heuristic_result not in exp_results:
109
+ return True
110
return False
111
112
def analyze_source(
0 commit comments