From 50be96aaf9b0e4b6faec6087a46adf637cb8a53a Mon Sep 17 00:00:00 2001 From: Algin Maduro Date: Fri, 23 Dec 2022 11:17:40 +0100 Subject: [PATCH] review comments --- .automation/test/terraform_fmt/README.md | 10 +++------- README.md | 4 ++-- lib/linter.sh | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.automation/test/terraform_fmt/README.md b/.automation/test/terraform_fmt/README.md index 1ce0310f..3318dfc7 100644 --- a/.automation/test/terraform_fmt/README.md +++ b/.automation/test/terraform_fmt/README.md @@ -1,4 +1,4 @@ -# AWS States language Test Cases +# Terraform Format Test Cases. This folder holds the test cases for **Terraform Formatting**. @@ -8,12 +8,8 @@ No Additional information is needed for this test case. ## Good Test Cases -The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted. - -- **Note:** They are linted utilizing the default linter rules. +The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when formatted. ## Bad Test Cases -The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted. - -- **Note:** They are linted utilizing the default linter rules. +The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when formatted. diff --git a/README.md b/README.md index ebc0f5a4..6171ff6e 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their codebase w | **Snakemake** | [snakefmt](https://github.com/snakemake/snakefmt/) / [snakemake --lint](https://snakemake.readthedocs.io/en/stable/snakefiles/writing_snakefiles.html#best-practices) | | **SQL** | [sql-lint](https://github.com/joereynolds/sql-lint) / [sqlfluff](https://github.com/sqlfluff/sqlfluff) | | **Tekton** | [tekton-lint](https://github.com/IBM/tekton-lint) | -| **Terraform** | [fmt](https://github.com/hashicorp/terraform) / [tflint](https://github.com/terraform-linters/tflint) / [terrascan](https://github.com/accurics/terrascan) | +| **Terraform** | [fmt](https://developer.hashicorp.com/terraform/cli/commands/fmt) / [tflint](https://github.com/terraform-linters/tflint) / [terrascan](https://github.com/accurics/terrascan) | | **Terragrunt** | [terragrunt](https://github.com/gruntwork-io/terragrunt) | | **TypeScript** | [ESLint](https://eslint.org/) / [standard js](https://standardjs.com/) | | **XML** | [LibXML](http://xmlsoft.org/) | @@ -283,7 +283,6 @@ But if you wish to select or exclude specific linters, we give you full control | **FILTER_REGEX_EXCLUDE** | `none` | Regular expression defining which files will be excluded from linting (ex: `.*src/test.*`) | | **FILTER_REGEX_INCLUDE** | `all` | Regular expression defining which files will be processed by linters (ex: `.*src/.*`) | | **GITHUB_ACTIONS_CONFIG_FILE** | `actionlint.yml` | Filename for [Actionlint configuration](https://github.com/rhysd/actionlint/blob/main/docs/config.md) (ex: `actionlint.yml`) | -| **GITHUB_ACTIONS_COMMAND_ARGS** | `null` | Additional arguments passed to `actionlint` command. Useful to [ignore some errors](https://github.com/rhysd/actionlint/blob/main/docs/usage.md#ignore-some-errors) | | **GITHUB_CUSTOM_API_URL** | `https://api.github.com` | Specify a custom GitHub API URL in case GitHub Enterprise is used: e.g. `https://github.myenterprise.com/api/v3` | | **GITHUB_DOMAIN** | `github.com` | Specify a custom GitHub domain in case GitHub Enterprise is used: e.g. `github.myenterprise.com` | | **GITLEAKS_CONFIG_FILE** | `.gitleaks.toml` | Filename for [GitLeaks configuration](https://github.com/zricethezav/gitleaks#configuration) (ex: `.geatleaks.toml`) | @@ -393,6 +392,7 @@ But if you wish to select or exclude specific linters, we give you full control | **VALIDATE_SQL** | `true` | Flag to enable or disable the linting process of the SQL language. | | **VALIDATE_SQLFLUFF** | `true` | Flag to enable or disable the linting process of the SQL language. (Utilizing: sqlfuff) | | **VALIDATE_TEKTON** | `true` | Flag to enable or disable the linting process of the Tekton language. | +| **VALIDATE_TERRAFORM_FMT** | `true` | Flag to enable or disable the formatting process of the Terraform files. | | **VALIDATE_TERRAFORM_TERRASCAN** | `true` | Flag to enable or disable the linting process of the Terraform language for security related issues. | | **VALIDATE_TERRAFORM_TFLINT** | `true` | Flag to enable or disable the linting process of the Terraform language. (Utilizing tflint) | | **VALIDATE_TERRAGRUNT** | `true` | Flag to enable or disable the linting process for Terragrunt files. | diff --git a/lib/linter.sh b/lib/linter.sh index d65a462d..d68a7e8a 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -967,7 +967,7 @@ LINTER_COMMANDS_ARRAY['STATES']="asl-validator --json-path" LINTER_COMMANDS_ARRAY['SQL']="sql-lint --config ${SQL_LINTER_RULES}" LINTER_COMMANDS_ARRAY['SQLFLUFF']="sqlfluff lint --config ${SQLFLUFF_LINTER_RULES}" LINTER_COMMANDS_ARRAY['TEKTON']="tekton-lint" -LINTER_COMMANDS_ARRAY['TERRAFORM_FMT']="terraform fmt -check" +LINTER_COMMANDS_ARRAY['TERRAFORM_FMT']="terraform fmt -check -diff" LINTER_COMMANDS_ARRAY['TERRAFORM_TFLINT']="tflint -c ${TERRAFORM_TFLINT_LINTER_RULES}" LINTER_COMMANDS_ARRAY['TERRAFORM_TERRASCAN']="terrascan scan -i terraform -t all -c ${TERRAFORM_TERRASCAN_LINTER_RULES} -f" LINTER_COMMANDS_ARRAY['TERRAGRUNT']="terragrunt hclfmt --terragrunt-check --terragrunt-log-level error --terragrunt-hclfmt-file"