Skip to content

Commit

Permalink
Ignore_bad_template and E0000 based ignore checks (#3226)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed May 9, 2024
1 parent 01a5424 commit fa980eb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/cfnlint/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,14 @@ 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

Expand Down

0 comments on commit fa980eb

Please sign in to comment.