joenye / coc-cfn-lint

Coc (coc.nvim) extension to lint CloudFormation via cfn-python-lint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support SAM templates

glnds opened this issue · comments

You can run :CocInfo inside vim to see the coc-cfn-lint logs and you'll see whether your file is being detected as CloudFormation. It currently doesn't do this check by looking at filename. Instead, it looks at file contents. By default, it will detect the file as CloudFormation if it contains both "AWSTemplateFormatVersion" and "Resources". In my case, I'm working with non-standard template files that don't always contain both these lines, so I have set the cfnlint.detectCfnRegExps as follows:
"cfnlint.detectCfnRegExps": ["AWS::", "\n?"Resources"?\s*:"],

cfn-lint works out of the box on SAM templates as well. I would suggest to scan for both AWSTemplateFormatVersion and Transform: AWS::Serverless*

Just my 2 cents