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

Mixed identation checks #2940

Open
2 tasks
wieshka opened this issue Nov 6, 2023 · 3 comments
Open
2 tasks

Mixed identation checks #2940

wieshka opened this issue Nov 6, 2023 · 3 comments

Comments

@wieshka
Copy link

wieshka commented Nov 6, 2023

Is this feature request related to a new rule or cfn-lint capabilities?

No response

Describe the feature you'd like to request

Currently, if template file contains rather valid JSON, but with mixed use of identation, cfn-lint does not show that as an issue, whilst boto3/botocore validate_template call will fail.

Describe the solution you'd like

cfn-lint should be able to detect mixed identation use and advise on fixing.

Additional context

This was found whilst investigating Sceptre/sceptre#1311 where cfn-linst, jq, and python -mjson.tool was used to validate early JSON, but all of them yielded that template is valid. cfn-lint should represent the same outcome as would botocore/boto3 iniated create stack which validates template.

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@kddejong
Copy link
Contributor

kddejong commented Nov 6, 2023

Can you provide a little more detail so I can reproduce the issue?

I've tried to make the template at Sceptre/sceptre#1311 (comment) code fail a few different ways (validate and create stack APIs) and I haven't been successful.

@wieshka
Copy link
Author

wieshka commented Nov 7, 2023

Seems that there was some github handling in the sample of mixed identiation, try with this one: https://gist.githubusercontent.com/wieshka/91d37fe765b2a1189fb3d80dff71f9ed/raw/33f1153c9d05ac2ef290d5187f203de38e1bf725/sample.json

@kddejong
Copy link
Contributor

kddejong commented Nov 7, 2023

So downloaded that file and then ran aws cloudformation validate-template --template-body file://\~/Downloads/sample.json and got no errors. You said you are using boto3/botocore so you are just hitting the APIs directly. I can try that too.

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

No branches or pull requests

2 participants