From 67a4479b2eba00b3c69c7c4032d36f09feb169eb Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Thu, 9 May 2024 12:41:40 -0700 Subject: [PATCH] Ignore_bad_template and E0000 based ignore checks --- src/cfnlint/core.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/cfnlint/core.py b/src/cfnlint/core.py index 2499e49601..f60ea0e915 100644 --- a/src/cfnlint/core.py +++ b/src/cfnlint/core.py @@ -305,9 +305,12 @@ def get_template_rules( if errors: _build_rule_cache(args) - if len(errors) == 1 and ignore_bad_template and errors[0].rule.id == "E0000": - return (template, __CACHED_RULES, []) - return (template, __CACHED_RULES, errors) + if ignore_bad_template or any("E0000".startswith(x) for x in args.ignore_checks): + errors = [err for err in errors if err.rule.id != "E0000"] + if errors: + return (template, __CACHED_RULES, errors) + else: + return (template, __CACHED_RULES, errors) args.template_args = template