Skip to content

Commit

Permalink
Merge pull request #2 from kddejong/ExitCodes
Browse files Browse the repository at this point in the history
Release 0.0.6
  • Loading branch information
kddejong authored Apr 17, 2018
2 parents d1b9ea8 + 9443bc7 commit 3c18379
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
- Test Ref resources to IAM Roles have good assume role documents. Example: Lambda Function Ref refers to an IAM Role that can be assume by Lambda.
- More Warnings around hard coded values (Regions, AccountIds) to help with the practice of reusability

### 0.1.0
### 0.0.6
###### Features
- Exit code non zero on errors or warnings

### 0.0.5
###### Features
- Testing CloudFormation resources against the Resource Spec
- Test Functions against supported included functions
Expand Down
5 changes: 3 additions & 2 deletions src/cfnlint/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ def main():
LOGGER.error('Supported regions are %s', supported_regions)
return(1)

exit_code = 0
if vars(args)['template']:
matches = list()
runner = cfnlint.Runner(
rules, vars(args)['template'], template, vars(args)['ignore_checks'],
vars(args)['regions'])
matches.extend(runner.run())
matches.sort(key=lambda x: (x.filename, x.linenumber, x.rule.id))

exit_code = len(matches)
if vars(args)['format'] == 'json':
print(json.dumps(matches, indent=4, cls=CustomEncoder))
else:
Expand All @@ -164,7 +165,7 @@ def main():
else:
parser.print_help()

return 0
return exit_code


class CustomEncoder(json.JSONEncoder):
Expand Down
2 changes: 1 addition & 1 deletion src/cfnlint/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

__version__ = '0.0.5'
__version__ = '0.0.6'

0 comments on commit 3c18379

Please sign in to comment.