Skip to content

Commit 1e78b4c

Browse files
authored
Validate ignore checks before returning result (#3429)
1 parent a5e77d5 commit 1e78b4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cfnlint/rules/_rules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,10 @@ def is_rule_enabled(self, rule: CloudFormationLintRule):
303303
def run_check(self, check, filename, rule_id, *args):
304304
"""Run a check"""
305305
try:
306-
matches = list(check(*args))
306+
matches = []
307+
for match in check(*args):
308+
if self.is_rule_enabled(match.rule):
309+
matches.append(match)
307310
return matches
308311
except Exception as err: # pylint: disable=W0703
309312
if self.is_rule_enabled(RuleError()):

0 commit comments

Comments
 (0)