aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Include cfn-python-lint checks into sam validate

Open Dunedan opened this issue 6 years ago • 3 comments

Describe your idea/feature/enhancement

Currently sam validate only catches a very small subset of problems with SAM templates. For example it doesn't even catch when the AWS::Serverless-2016-10-31 transformation isn't specified in the template. It'd be great if users could be more confident that a template works if it passed sam validate successfully.

Proposal

For better validation cfn-python-lint comes to mind, which already does a great job detecting invalid CloudFormation and SAM templates. It'd be great if the checks done by cfn-python-lint would be included into sam validate as well. As both are implemented in Python it's probably straight forward to add such support.

The idea is not new and has already been suggested by @jfuss in https://github.com/awslabs/aws-sam-cli/issues/686#issuecomment-450193749 (and probably others somewhere else). @heitorlessa just suggested in Slack to track it properly with such a feature request. So here it is. :slightly_smiling_face:

Dunedan avatar Jan 13 '19 15:01 Dunedan

Fun thing is that cfn-python-lint uses SAM for the Transformation. (before linting the template).. If SAM would use the linter, the circle is round 😎

fatbasstard avatar Jan 21 '19 21:01 fatbasstard

I believe you confuse aws-sam-translator (which is part of the SAM repository) with the SAM CLI. cfn-python-lint depends on aws-sam-translator and so does the SAM CLI. So no circular dependencies, but both rely on aws-sam-translator instead.

Dunedan avatar Jan 21 '19 21:01 Dunedan

Yes, you're completely right... My bad, I got enthousiastic :tada:

fatbasstard avatar Jan 21 '19 22:01 fatbasstard

Released with v1.69.0. Closing this issue.

sriram-mv avatar Jan 12 '23 02:01 sriram-mv

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Jan 12 '23 02:01 github-actions[bot]