Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Need to use platform-specific path separator in ignore_templates #2729

Open
coyoteecd opened this issue May 5, 2023 · 3 comments
Open

Need to use platform-specific path separator in ignore_templates #2729

coyoteecd opened this issue May 5, 2023 · 3 comments
Labels
researching Researching the issue

Comments

@coyoteecd
Copy link
Contributor

CloudFormation Lint Version

0.77.4

What operating system are you using?

Windows

Describe the bug

On my Windows dev PC, I cannot use / as path separator for the ignore_templates entries in .cfnlintrc. Using the OS-specific \ works, however it then breaks when running cfn-lint on our Ubuntu build machine.

This is different from behavior of templates section where I can use / as path separator and it works fine on both operating systems.

Expected behavior

I expect ignore_templates to accept paths with / as separator on both Windows and Linux-based OSes. The .cfnlintrc file shown below should work and correctly ignore excluded.yml file:

templates:
- resources/**/*.yml
ignore_templates:
- resources/excluded.yml

Reproduction template

No template necessary, this is a config issue

@kddejong kddejong added the researching Researching the issue label May 8, 2023
@kddejong
Copy link
Contributor

kddejong commented May 8, 2023

agreed on this one. I need to investigate it but this should work the same way.

@whoDoneItAgain
Copy link
Contributor

i can confirm this behavior as well. running win11 0.77.5.

I have to add both variations to my ignore_templates section to get it to properly ignore while the templates section only has the forward slash

@kddejong
Copy link
Contributor

I took some time to look into this today. So here is what I think... when sending in a /**/ on Windows to the glob it will return the windows normalized names. However, if you have a fully hardcoded name it will just send it back. I think the best solution here is to normalize all the paths to windows based structure. That's what the PR above does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
researching Researching the issue
Projects
None yet
Development

No branches or pull requests

3 participants