Skip to content

Commit

Permalink
Merge pull request #16 from kddejong/Fix/PrepParameters
Browse files Browse the repository at this point in the history
Prep for cli options in which multiple templates can be specified
  • Loading branch information
Chuck Meyer authored Jul 19, 2018
2 parents a921252 + 2f3c511 commit 1388e07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
## AWS Cfn Lint Atom
Provides IDE specific integration to [cfn-lint](https://github.com/awslabs/cfn-python-lint)

![Preview](cfn-linter.png)

Provides IDE specific integration to cfn-lint. https://github.com/awslabs/cfn-python-lint

## Requires
#### cfn-lint
For atom-cfn-lint to work you need to have cfn-lint installed.
```pip install cfn-lint```

## Verify Installation
#### JSON/YAML Templates
Atom-cfn-lint is coded to 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.
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.

##### Example
You can use the following example to verify that the installation was successful:
Expand All @@ -29,6 +28,10 @@ Result (`Type` is marked as an error):

See [Templates](spec/fixtures/templates/) for more examples.

## Contribute

The code for this plugin can be found on GitHub at [awslabs/aws-cfn-lint-atom](https://github.com/awslabs/aws-cfn-lint-atom)

## License

This library is licensed under the Apache 2.0 License.
4 changes: 2 additions & 2 deletions lib/atom-cfn-lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ module.exports = {

let i
if (Array.isArray(this.ignoreRules) && this.ignoreRules.length) {
args = args.concat(['--ignore-checks'])
for (i = 0; i < this.ignoreRules.length; i += 1) {
args = args.concat(['--ignore-checks'])
args = args.concat([this.ignoreRules[i]])
}
}

if (Array.isArray(this.appendRules) && this.appendRules.length) {
args = args.concat(['--append-rules'])
for (i = 0; i < this.appendRules.length; i += 1) {
args = args.concat(['--append-rules'])
args = args.concat([this.appendRules[i]])
}
}
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/templates/append.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Parameters:
- Test
TestEnvironment:
Type: String
Default: String
Default: Test
Description: Another Environment
AllowedValues:
- Dev
Expand Down

0 comments on commit 1388e07

Please sign in to comment.