diff --git a/README.md b/README.md index 0d3fe23f0c..4d504991e8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # CloudFormation Linter + + [![Build Status](https://travis-ci.com/awslabs/cfn-python-lint.svg?branch=master)](https://travis-ci.com/awslabs/cfn-python-lint) [![PyPI version](https://badge.fury.io/py/cfn-lint.svg)](https://badge.fury.io/py/cfn-lint) [![codecov](https://codecov.io/gh/awslabs/cfn-python-lint/branch/master/graph/badge.svg)](https://codecov.io/gh/awslabs/cfn-python-lint) @@ -8,6 +10,7 @@ Validate CloudFormation yaml/json templates against the CloudFormation spec and checks. Includes checking valid values for resource properties and best practices. ### Warning + This is an attempt to provide validation for CloudFormation templates properties and their values. For values things can get pretty complicated (mappings, joins, splits, conditions, and nesting those functions inside each other) so its a best effort to @@ -15,11 +18,11 @@ validate those values but the promise is to not fail if we can't understand or t all the things that could be going on. #### Serverless Application Model + The Serverless Application Model (SAM) is supported by the linter. The template is -transformed using AWS SAM (https://github.com/awslabs/serverless-application-model) +transformed using AWS SAM [https://github.com/awslabs/serverless-application-model](https://github.com/awslabs/serverless-application-model) before the linter processes the template. - ## Install Python 2.7+ and 3.4+ are supported. @@ -30,6 +33,7 @@ Python 2.7+ and 3.4+ are supported. `python setup.py clean --all` then `python setup.py install`. ### Editor Plugins + There are IDE plugins available to get direct linter feedback from you favorite editor: * [Atom](https://atom.io/packages/atom-cfn-lint) @@ -41,10 +45,12 @@ There are IDE plugins available to get direct linter feedback from you favorite * [IntelliJ IDEA](https://plugins.jetbrains.com/plugin/10973-cfn-lint/update/48247) ## Basic Usage + - `cfn-lint template.yaml` - `cfn-lint -t template.yaml` ##### Lint multiple files + Multiple files can be linted by either specifying multiple specific files: - `cfn-lint template1.yaml template2.yaml` @@ -53,33 +59,39 @@ Multiple files can be linted by either specifying multiple specific files: Multiple files can also be specified using wildcards (globbing): Lint all `yaml` files in `path`: + - `cfn-lint path/*.yaml` Lint all `yaml` files in `path` and all subdirectories (recursive): + - `cfn-lint path/to/templates/**/*.yaml` *Note*: Glob in Python 3.5 supports recursive searching `**/*.yaml`. If you are using an earlier version of Python you will have to handle this manually (`folder1/*.yaml`, `folder2/*.yaml`, etc). ##### Specifying the template as an input stream + The template to be linted can also be passed using standard input: - `cat path/template.yaml | cfn-lint -` - ##### Specifying the template with other parameters + - `cfn-lint -r us-east-1 ap-south-1 -- template.yaml` - `cfn-lint -r us-east-1 ap-south-1 -t template.yaml` ## Configuration ### Command Line + From a command prompt run `cfn-lint ` to run standard linting of the template. ### Config File + You can define a yaml file in your project or home folder called `.cfnlintrc`. In that file you can specify settings from the parameter section below. Example: -``` + +```yaml templates: - test/fixtures/templates/good/**/*.yaml include_checks: @@ -107,11 +119,14 @@ Optional parameters: | -v, --version | | | Version of cfn-lint | ### Info Rules + To maintain backwards compatibility `info` rules are not included by default. To include these rules you will need to include `-c I` or `--include-checks I` ### Metadata + Inside the root level Metadata key you can configure cfn-lint using the supported parameters. -``` + +```yaml Metadata: cfn-lint: config: @@ -123,20 +138,23 @@ Metadata: ``` ### Precedence + cfn-lint applies the configuration from the CloudFormation Metadata first and then overrides those values with anything specified in the CLI. ### Getting Started Guides + There are [getting started guides](/docs/getting_started) available in the documentation section to help with integrating `cfn-lint` or creating rules. ## Rules + This linter checks the CloudFormation by processing a collection of Rules, where every rules handles a specific function check or validation of the template. This collection of rules can be extended with custom rules using the `--append-rules` argument. More information describing how rules are set up and an overview of all the Rules that are applied by this linter are documented [here](docs/rules.md) - ## Customize specifications + The linter follows the [CloudFormation specifications](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) by default. However, for your use case specific requirements might exist. For example, within your organisation it might be mandatory to use [Tagging](https://aws.amazon.com/answers/account-management/aws-tagging-strategies/). The linter provides the possibility to implement these customized specifications using the `--override-spec` argument. @@ -144,6 +162,7 @@ The linter provides the possibility to implement these customized specifications More information about how this feature works is documented [here](docs/customize_specifications.md) ## pre-commit + If you'd like cfn-lint to be run automatically when making changes to files in your Git repository, you can install [pre-commit](https://pre-commit.com/) and add the following text to your repositories' `.pre-commit-config.yaml`: ```yaml diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000..78e9cc6901 Binary files /dev/null and b/logo.png differ