From 4c7f32ef9ab3f89dcc75be35488443e3b809fd8a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Fri, 24 Jul 2020 08:20:41 -0500 Subject: [PATCH] small cleanup --- .automation/test/terraform/README.md | 19 +++++++++++++ .../test/terraform_terrascan/README.md | 19 +++++++++++++ lib/linter.sh | 28 +++++++++---------- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/.automation/test/terraform/README.md b/.automation/test/terraform/README.md index e69de29b..6cb4f692 100644 --- a/.automation/test/terraform/README.md +++ b/.automation/test/terraform/README.md @@ -0,0 +1,19 @@ +# AWS States language Test Cases + +This folder holds the test cases for **Terraform**. + +## Additional Docs + +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. + +## 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. diff --git a/.automation/test/terraform_terrascan/README.md b/.automation/test/terraform_terrascan/README.md index e69de29b..036699d9 100644 --- a/.automation/test/terraform_terrascan/README.md +++ b/.automation/test/terraform_terrascan/README.md @@ -0,0 +1,19 @@ +# AWS States language Test Cases + +This folder holds the test cases for **Terraform terrascan**. + +## Additional Docs + +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. + +## 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. diff --git a/lib/linter.sh b/lib/linter.sh index 5e5aa6da..d712ab4b 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1375,13 +1375,13 @@ if [ "${VALIDATE_JSON}" == "true" ]; then LintCodebase "JSON" "jsonlint" "jsonlint" ".*\.\(json\)\$" "${FILE_ARRAY_JSON[@]}" fi -###################### -# JSX LINTING # -###################### +############### +# JSX LINTING # +############### if [ "${VALIDATE_JSX}" == "true" ]; then - ############################# - # Lint the JSX files # - ############################# + ###################### + # Lint the JSX files # + ###################### # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" LintCodebase "JSX" "eslint" "eslint --no-eslintrc -c ${JAVASCRIPT_LINTER_RULES}" ".*\.\(jsx\)\$" "${FILE_ARRAY_JSX[@]}" fi @@ -1566,9 +1566,9 @@ if [ "${VALIDATE_TERRAFORM}" == "true" ]; then LintCodebase "TERRAFORM" "tflint" "tflint -c ${TERRAFORM_LINTER_RULES}" ".*\.\(tf\)\$" "${FILE_ARRAY_TERRAFORM[@]}" fi -##################### +############################### # TERRAFORM TERRASCAN LINTING # -##################### +############################### if [ "${VALIDATE_TERRAFORM_TERRASCAN}" == "true" ]; then ############################ # Lint the Terraform files # @@ -1577,13 +1577,13 @@ if [ "${VALIDATE_TERRAFORM_TERRASCAN}" == "true" ]; then LintCodebase "TERRAFORM_TERRASCAN" "terrascan" "terrascan -f " ".*\.\(tf\)\$" "${FILE_ARRAY_TERRAFORM_TERRASCAN[@]}" fi -###################### -# TSX LINTING # -###################### +############### +# TSX LINTING # +############### if [ "${VALIDATE_TSX}" == "true" ]; then - ############################# - # Lint the TSX files # - ############################# + ###################### + # Lint the TSX files # + ###################### LintCodebase "TSX" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(tsx\)\$" "${FILE_ARRAY_TSX[@]}" fi