Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cfn-lint considers configuration broken when ignore_templates doesn't match any files #3881

Closed
dmarinuswoodwing opened this issue Dec 16, 2024 · 1 comment · Fixed by #3900

Comments

@dmarinuswoodwing
Copy link

CloudFormation Lint Version

1.22.0

What operating system are you using?

Linux

Describe the bug

cfn-lint considers configuration broken when ignore_templates doesn't match any files

We've added node_modules/** to ignore_templates but now cfn-lint fails since 1.22.0 when this directory doesn't exists / is empty.

The error message is non descriptive:

E0003 node_modules/** could not be processed by glob.glob
None:1:1

if not add_filenames and not self.ignore_bad_template:
raise ValueError(f"{filename} could not be processed by glob.glob")

Seems to be introduced by #3862 / @kddejong

Expected behavior

Allow excluding of templates that don't exists.

Reproduction template

Use the following .cfnlintrc

regions:
  - us-east-1
  - eu-west-1
templates:
  - "**/*.yaml"
  - "**/*.yml"
ignore_templates:
  - "node_modules/**"
@kddejong
Copy link
Contributor

The quick solution is ignore_bad_template but going to leave this open as I am researching a few more things.

regions:
  - us-east-1
  - eu-west-1
templates:
  - "**/*.yaml"
  - "**/*.yml"
ignore_bad_template: true
ignore_templates:
  - "node_modules/**"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants