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

Recognize more CloudFormation templates #29

Open
PatMyron opened this issue Sep 6, 2020 · 0 comments
Open

Recognize more CloudFormation templates #29

PatMyron opened this issue Sep 6, 2020 · 0 comments

Comments

@PatMyron
Copy link

PatMyron commented Sep 6, 2020

const isCfnRegex = new RegExp('"?AWSTemplateFormatVersion"?')
let isCfn = false
activeEditor.buffer.buffer.getLines().forEach((line) => {
if (isCfnRegex.exec(line)) {
isCfn = true
}
})

Update README too:

cfn-lint-atom/README.md

Lines 12 to 13 in 2f3c511

#### JSON/YAML Templates
Atom-cfn-lint will work with JSON and YAML files but the goal is to only scan CloudFormation templates. As a result we look for `AWSTemplateFormatVersion` being defined in the file. CloudFormation only requires `Resources` to be defined but this is too generic for assuming that the file is a CloudFormation template.


Similar discussions: aws-cloudformation/cfn-lint#1171, aws-cloudformation/cfn-lint-visual-studio-code#99, aws/aws-toolkit-jetbrains#1715 (comment), https://github.com/github/super-linter/pull/231#discussion_r445708695, mwpearce/vscode-cfn-nag#6, joenye/coc-cfn-lint#3 (comment)

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

1 participant