Skip to content

Commit fa980eb

Browse files
authored
Ignore_bad_template and E0000 based ignore checks (#3226)
1 parent 01a5424 commit fa980eb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/cfnlint/core.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,14 @@ def get_template_rules(
305305

306306
if errors:
307307
_build_rule_cache(args)
308-
if len(errors) == 1 and ignore_bad_template and errors[0].rule.id == "E0000":
309-
return (template, __CACHED_RULES, [])
310-
return (template, __CACHED_RULES, errors)
308+
if ignore_bad_template or any(
309+
"E0000".startswith(x) for x in args.ignore_checks
310+
):
311+
errors = [err for err in errors if err.rule.id != "E0000"]
312+
if errors:
313+
return (template, __CACHED_RULES, errors)
314+
else:
315+
return (template, __CACHED_RULES, errors)
311316

312317
args.template_args = template
313318

0 commit comments

Comments
 (0)