From 0101612f7ac9c80d1b4d16b6a3cac719ac1acc65 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Mon, 22 Jun 2020 08:59:31 -0500 Subject: [PATCH 1/7] Fix shellcheck exclusions --- .../ghe-initialize/templates/ghe-config-apply.sh | 3 +-- .automation/upload-docker.sh | 5 ++--- lib/linter.sh | 16 +++++----------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh index 5a0f32dd..f33f0475 100644 --- a/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh +++ b/.automation/test/ansible/ghe-initialize/templates/ghe-config-apply.sh @@ -87,8 +87,7 @@ CheckGHEProcess() #################################################### # Check to see if the process is alive and running # #################################################### - # shellcheck disable=SC2009 - CHECK_PROCESS_CMD=$(ps -aef |grep "$GHE_APPLY_COMMAND" |grep -v grep 2>&1) + CHECK_PROCESS_CMD=$(pgrep -f "$GHE_APPLY_COMMAND" 2>&1) ####################### # Load the error code # diff --git a/.automation/upload-docker.sh b/.automation/upload-docker.sh index 82659af0..55719d6b 100755 --- a/.automation/upload-docker.sh +++ b/.automation/upload-docker.sh @@ -166,7 +166,7 @@ ValidateInput() ############################## # Get the name of the branch # ############################## - BRANCH_NAME=$(git branch --contains "$GITHUB_SHA" |awk '{print $2}' 2>&1) + BRANCH_NAME=$(git -C "$GITHUB_WORKSPACE" branch --contains "$GITHUB_SHA" |awk '{print $2}' 2>&1) ####################### # Load the error code # @@ -407,8 +407,7 @@ UploadImage() REPO=$(echo "$GET_INFO_CMD" | awk '{print $1}') TAG=$(echo "$GET_INFO_CMD" | awk '{print $2}') IMAGE_ID=$(echo "$GET_INFO_CMD" | awk '{print $3}') - # shellcheck disable=SC2116 - SIZE=$(echo "${GET_INFO_CMD##* }") + SIZE="${GET_INFO_CMD##* }" ################### # Print the goods # diff --git a/lib/linter.sh b/lib/linter.sh index e4d64c3c..0c2287ad 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# shellcheck disable=SC1003,SC2016,SC1091 ################################################################################ ################################################################################ @@ -265,8 +264,7 @@ GetLinterVersions() ################### # Get the version # ################### - # shellcheck disable=SC2207 - GET_VERSION_CMD=($("$LINTER" --version 2>&1)) + mapfile -t GET_VERSION_CMD < <("$LINTER" --version 2>&1) ####################### # Load the error code # @@ -357,11 +355,9 @@ GetStandardRules() # Only env vars that are marked as true GET_ENV_ARRAY=() if [[ "$LINTER" == "javascript" ]]; then - # shellcheck disable=SC2207 - GET_ENV_ARRAY=($(yq .env "$JAVASCRIPT_LINTER_RULES" |grep true)) + mapfile -t GET_ENV_ARRAY < <(yq .env "$JAVASCRIPT_LINTER_RULES" | grep true) elif [[ "$LINTER" == "typescript" ]]; then - # shellcheck disable=SC2207 - GET_ENV_ARRAY=($(yq .env "$TYPESCRIPT_LINTER_RULES" |grep true)) + mapfile -t GET_ENV_ARRAY < <(yq .env "$TYPESCRIPT_LINTER_RULES" | grep true) fi ####################### @@ -612,8 +608,7 @@ GetGitHubVars() ###################### # Get the GitHub Org # ###################### - # shellcheck disable=SC2002 - GITHUB_ORG=$(cat "$GITHUB_EVENT_PATH" | jq -r '.repository.owner.login' ) + GITHUB_ORG=$(jq -r '.repository.owner.login' < "$GITHUB_EVENT_PATH" ) ############################ # Validate we have a value # @@ -629,8 +624,7 @@ GetGitHubVars() ####################### # Get the GitHub Repo # ####################### - # shellcheck disable=SC2002 - GITHUB_REPO=$(cat "$GITHUB_EVENT_PATH"| jq -r '.repository.name' ) + GITHUB_REPO=$(jq -r '.repository.name' < "$GITHUB_EVENT_PATH" ) ############################ # Validate we have a value # From 889179e0bf4aed42bb7a794cd65ab44d249bfeaf Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 30 Jun 2020 09:24:28 -0500 Subject: [PATCH 2/7] Fix ShellCheck issues with new code base --- .vscode/testlinter.sh | 2 +- lib/buildFileList.sh | 6 +++--- lib/linter.sh | 11 ++++------- lib/worker.sh | 18 +++++------------- 4 files changed, 13 insertions(+), 24 deletions(-) diff --git a/.vscode/testlinter.sh b/.vscode/testlinter.sh index 8d778d16..69497bb5 100644 --- a/.vscode/testlinter.sh +++ b/.vscode/testlinter.sh @@ -22,5 +22,5 @@ fi ######################### export RUN_LOCAL=true -# shellcheck disable=SC1091,SC1090 +# shellcheck source=../lib/linter.sh source "$PWD"/lib/linter.sh diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index dde4c70c..0f011b3b 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# shellcheck disable=SC2034 ################################################################################ ################################################################################ @@ -56,8 +55,7 @@ function BuildFileList() ################################################# # Get the Array of files changed in the commits # ################################################# - # shellcheck disable=SC2207 - RAW_FILE_ARRAY=($(cd "$GITHUB_WORKSPACE" || exit; git diff --name-only "$DEFAULT_BRANCH..$GITHUB_SHA" --diff-filter=d 2>&1)) + mapfile -t RAW_FILE_ARRAY < <(git -C "$GITHUB_WORKSPACE" diff --name-only "$DEFAULT_BRANCH..$GITHUB_SHA" --diff-filter=d 2>&1) ####################### # Load the error code # @@ -413,6 +411,8 @@ function BuildFileList() fi done + echo $READ_ONLY_CHANGE_FLAG > /dev/null 2>&1 || true # Workaround SC2034 + ######################################### # Need to switch back to branch of code # ######################################### diff --git a/lib/linter.sh b/lib/linter.sh index 0c2287ad..069a55e2 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -9,8 +9,11 @@ ######################### # Source Function Files # ######################### +# shellcheck source=../lib/buildFileList.sh source /action/lib/buildFileList.sh # Source the function script(s) +# shellcheck source=../lib/validation.sh source /action/lib/validation.sh # Source the function script(s) +# shellcheck source=../lib/worker.sh source /action/lib/worker.sh # Source the function script(s) ########### @@ -146,15 +149,10 @@ DEFAULT_IFS="$IFS" # Get the Default IFS for updating ############################################################### # Default Vars that are called in Subs and need to be ignored # ############################################################### -# shellcheck disable=SC2034 DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors -# shellcheck disable=SC2034 RAW_FILE_ARRAY=() # Array of all files that were changed -# shellcheck disable=SC2034 READ_ONLY_CHANGE_FLAG=0 # Flag set to 1 if files changed are not txt or md -# shellcheck disable=SC2034 TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore -# shellcheck disable=SC2034 DEFAULT_ANSIBLE_DIRECTORY="$GITHUB_WORKSPACE/ansible" # Default Ansible Directory ########################## @@ -1103,8 +1101,7 @@ if [ "$VALIDATE_OPENAPI" == "true" ]; then ############################################################################### IFS=$'\n' - # shellcheck disable=SC2207 - LIST_FILES=($(cd "$GITHUB_WORKSPACE" || exit; find . -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1)) + mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE" -type f -regex ".*\.\(yml\|yaml\|json\)\$" 2>&1) for FILE in "${LIST_FILES[@]}" do if DetectOpenAPIFile "$FILE"; then diff --git a/lib/worker.sh b/lib/worker.sh index 287215dc..70ffc4e9 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -38,7 +38,6 @@ function LintCodebase() ####################################### # Validate we have jsonlint installed # ####################################### - # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) ####################### @@ -91,8 +90,7 @@ function LintCodebase() ################################# # Get list of all files to lint # ################################# - # shellcheck disable=SC2207,SC2086 - LIST_FILES=($(cd "$GITHUB_WORKSPACE" || exit; find . -type f -regex "$FILE_EXTENSIONS" 2>&1)) + mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE" -type f -regex "$FILE_EXTENSIONS" 2>&1) ########################### # Set IFS back to default # @@ -229,7 +227,6 @@ function TestCodebase() ##################################### # Validate we have linter installed # ##################################### - # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) ####################### @@ -263,8 +260,7 @@ function TestCodebase() ################################# # Get list of all files to lint # ################################# - # shellcheck disable=SC2207,SC2086,SC2010 - LIST_FILES=($(cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER" || exit; ls ansible/ | grep ".yml" 2>&1)) + mapfile -t LIST_FILES < <(ls "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/*.yml" 2>&1) else ############################################################################### # Set the file seperator to newline to allow for grabbing objects with spaces # @@ -274,8 +270,7 @@ function TestCodebase() ################################# # Get list of all files to lint # ################################# - # shellcheck disable=SC2207,SC2086 - LIST_FILES=($(cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER" || exit; find "$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "*./ansible*" 2>&1)) + mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "*./ansible*" 2>&1) ########################### # Set IFS back to default # @@ -505,7 +500,6 @@ function LintAnsibleFiles() ########################################### # Validate we have ansible-lint installed # ########################################### - # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) ####################### @@ -551,14 +545,12 @@ function LintAnsibleFiles() if [ "$VALIDATE_ALL_CODEBASE" == "false" ]; then # We need to only check the ansible playbooks that have updates #LIST_FILES=("${ANSIBLE_ARRAY[@]}") - # shellcheck disable=SC2164,SC2010,SC2207 - LIST_FILES=($(cd "$ANSIBLE_DIRECTORY"; ls | grep ".yml" 2>&1)) + mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY/*.yml" 2>&1) else ################################# # Get list of all files to lint # ################################# - # shellcheck disable=SC2164,SC2010,SC2207 - LIST_FILES=($(cd "$ANSIBLE_DIRECTORY"; ls | grep ".yml" 2>&1)) + mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY/*.yml" 2>&1) fi ############################################################### From c6594d8fb5cf6a35e412e2042174a6009c561509 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Tue, 30 Jun 2020 09:56:15 -0500 Subject: [PATCH 3/7] Fix new issues --- .vscode/testlinter.sh | 2 +- lib/buildFileList.sh | 2 +- lib/linter.sh | 11 ++++++++--- lib/worker.sh | 28 ++++------------------------ 4 files changed, 14 insertions(+), 29 deletions(-) diff --git a/.vscode/testlinter.sh b/.vscode/testlinter.sh index 69497bb5..50427028 100644 --- a/.vscode/testlinter.sh +++ b/.vscode/testlinter.sh @@ -22,5 +22,5 @@ fi ######################### export RUN_LOCAL=true -# shellcheck source=../lib/linter.sh +# shellcheck source=/dev/null source "$PWD"/lib/linter.sh diff --git a/lib/buildFileList.sh b/lib/buildFileList.sh index 0f011b3b..c10284c8 100755 --- a/lib/buildFileList.sh +++ b/lib/buildFileList.sh @@ -411,7 +411,7 @@ function BuildFileList() fi done - echo $READ_ONLY_CHANGE_FLAG > /dev/null 2>&1 || true # Workaround SC2034 + echo ${READ_ONLY_CHANGE_FLAG} > /dev/null 2>&1 || true # Workaround SC2034 ######################################### # Need to switch back to branch of code # diff --git a/lib/linter.sh b/lib/linter.sh index 069a55e2..3a2696ca 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -9,11 +9,11 @@ ######################### # Source Function Files # ######################### -# shellcheck source=../lib/buildFileList.sh +# shellcheck source=/dev/null source /action/lib/buildFileList.sh # Source the function script(s) -# shellcheck source=../lib/validation.sh +# shellcheck source=/dev/null source /action/lib/validation.sh # Source the function script(s) -# shellcheck source=../lib/worker.sh +# shellcheck source=/dev/null source /action/lib/worker.sh # Source the function script(s) ########### @@ -150,10 +150,15 @@ DEFAULT_IFS="$IFS" # Get the Default IFS for updating # Default Vars that are called in Subs and need to be ignored # ############################################################### DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors +echo "${DEFAULT_DISABLE_ERRORS}" > /dev/null 2>&1 || true # Workaround SC2034 RAW_FILE_ARRAY=() # Array of all files that were changed +echo "${RAW_FILE_ARRAY[*]}" > /dev/null 2>&1 || true # Workaround SC2034 READ_ONLY_CHANGE_FLAG=0 # Flag set to 1 if files changed are not txt or md +echo "${READ_ONLY_CHANGE_FLAG}" > /dev/null 2>&1 || true # Workaround SC2034 TEST_CASE_FOLDER='.automation/test' # Folder for test cases we should always ignore +echo "${TEST_CASE_FOLDER}" > /dev/null 2>&1 || true # Workaround SC2034 DEFAULT_ANSIBLE_DIRECTORY="$GITHUB_WORKSPACE/ansible" # Default Ansible Directory +echo "${DEFAULT_ANSIBLE_DIRECTORY}" > /dev/null 2>&1 || true # Workaround SC2034 ########################## # Array of changed files # diff --git a/lib/worker.sh b/lib/worker.sh index 70ffc4e9..10e8ca42 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -253,30 +253,10 @@ function TestCodebase() ########################## LIST_FILES=() - ############################################ - # Check if its ansible, as its the outlier # - ############################################ - if [[ "$FILE_TYPE" == "ANSIBLE" ]]; then - ################################# - # Get list of all files to lint # - ################################# - mapfile -t LIST_FILES < <(ls "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/*.yml" 2>&1) - else - ############################################################################### - # Set the file seperator to newline to allow for grabbing objects with spaces # - ############################################################################### - IFS=$'\n' - - ################################# - # Get list of all files to lint # - ################################# - mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "*./ansible*" 2>&1) - - ########################### - # Set IFS back to default # - ########################### - IFS="$DEFAULT_IFS" - fi + ################################# + # Get list of all files to lint # + ################################# + mapfile -t LIST_FILES < <(find "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" -type f -regex "$FILE_EXTENSIONS" ! -path "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible/ghe-initialize/*" 2>&1) ################## # Lint the files # From b1525fa76189574649c8d2ac64b18354dd95d0c8 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:27:36 -0500 Subject: [PATCH 4/7] that loop was dumb --- lib/worker.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index 10e8ca42..c7444676 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -519,19 +519,10 @@ function LintAnsibleFiles() ###################################################### if [ -d "$ANSIBLE_DIRECTORY" ]; then - ############################################################ - # Check to see if we need to go through array or all files # - ############################################################ - if [ "$VALIDATE_ALL_CODEBASE" == "false" ]; then - # We need to only check the ansible playbooks that have updates - #LIST_FILES=("${ANSIBLE_ARRAY[@]}") - mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY/*.yml" 2>&1) - else - ################################# - # Get list of all files to lint # - ################################# - mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY/*.yml" 2>&1) - fi + ################################# + # Get list of all files to lint # + ################################# + mapfile -t LIST_FILES < <(ls "$ANSIBLE_DIRECTORY/*.yml" 2>&1) ############################################################### # Set the list to empty if only MD and TXT files were changed # From ea65af02dbc15066a206bf4fec2f808072521974 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:28:47 -0500 Subject: [PATCH 5/7] better logic --- lib/worker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index c7444676..3b78bbe7 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -435,7 +435,7 @@ function RunTestCases() TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "typescript" TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin $TYPESCRIPT_STANDARD_LINTER_RULES" ".*\.\(ts\)\$" "typescript" TestCodebase "DOCKER" "/dockerfilelint/bin/dockerfilelint" "/dockerfilelint/bin/dockerfilelint -c $DOCKER_LINTER_RULES" ".*\(Dockerfile\)\$" "docker" - TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c $ANSIBLE_LINTER_RULES" "ansible-lint" "ansible" + TestCodebase "ANSIBLE" "ansible-lint" "ansible-lint -v -c $ANSIBLE_LINTER_RULES" ".*\.\(yml\|yaml\)\$" "ansible" TestCodebase "TERRAFORM" "tflint" "tflint -c $TERRAFORM_LINTER_RULES" ".*\.\(tf\)\$" "terraform" TestCodebase "CFN" "cfn-lint" "cfn-lint --config-file $CFN_LINTER_RULES" ".*\.\(json\|yml\|yaml\)\$" "cfn" TestCodebase "POWERSHELL" "pwsh" "pwsh -c Invoke-ScriptAnalyzer -EnableExit -Settings $POWERSHELL_LINTER_RULES -Path" ".*\.\(ps1\|psm1\|psd1\|ps1xml\|pssc\|psrc\|cdxml\)\$" "powershell" From 64a79027b443f2bc78d6b834d34732fa85150e0a Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 30 Jun 2020 15:23:24 -0500 Subject: [PATCH 6/7] adding logic for skipping tests --- lib/worker.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/worker.sh b/lib/worker.sh index 3b78bbe7..375afd44 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -212,6 +212,7 @@ function TestCodebase() LINTER_COMMAND="$3" # Pull the variable and remove from array path (Example: jsonlint -c ConfigFile /path/to/file) FILE_EXTENSIONS="$4" # Pull the variable and remove from array path (Example: *.json) INDVIDUAL_TEST_FOLDER="$5" # Folder for specific tests + TESTS_RAN=0 # Incremented when tests are ran, this will help find failed finds ################ # print header # @@ -327,7 +328,7 @@ function TestCodebase() ################################ # Lint the file with the rules # ################################ - LINT_CMD=$(cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/ansible" || exit; $LINTER_COMMAND "$FILE" 2>&1) + LINT_CMD=$(cd "$GITHUB_WORKSPACE/$TEST_CASE_FOLDER/$INDVIDUAL_TEST_FOLDER" || exit; $LINTER_COMMAND "$FILE" 2>&1) elif [[ "$FILE_TYPE" == "POWERSHELL" ]]; then ################################ # Lint the file with the rules # @@ -362,11 +363,15 @@ function TestCodebase() echo "ERROR: Linter CMD:[$LINTER_COMMAND $FILE]" # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) + # Increment counter that check was ran + (("$TESTS_RAN++")) else ########### # Success # ########### echo " - File:[$FILE_NAME] was linted with [$LINTER_NAME] successfully" + # Increment counter that check was ran + (("$TESTS_RAN++")) fi else ####################################### @@ -385,14 +390,30 @@ function TestCodebase() echo "ERROR: Linter CMD:[$LINTER_COMMAND $FILE]" # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) + # Increment counter that check was ran + (("$TESTS_RAN++")) else ########### # Success # ########### echo " - File:[$FILE_NAME] failed test case with [$LINTER_NAME] successfully" + # Increment counter that check was ran + (("$TESTS_RAN++")) fi fi done + + ############################## + # Validate we ran some tests # + ############################## + if [ "$TESTS_RAN" -eq 0 ]; then + ################################################# + # We failed to find files and no tests were ran # + ################################################# + echo "ERROR! Failed to find any tests ran for the Linter:[$LINTER_NAME]"! + echo "Please validate logic or that tests exist!" + exit 1 + fi } ################################################################################ #### Function RunTestCases ##################################################### From eb2f960a3f12e27ef8789e8bb6e70861e8b5519f Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Tue, 30 Jun 2020 15:34:33 -0500 Subject: [PATCH 7/7] actually the right way --- lib/worker.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/worker.sh b/lib/worker.sh index 375afd44..fc1d65f1 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -364,14 +364,14 @@ function TestCodebase() # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) # Increment counter that check was ran - (("$TESTS_RAN++")) + ((TESTS_RAN++)) else ########### # Success # ########### echo " - File:[$FILE_NAME] was linted with [$LINTER_NAME] successfully" # Increment counter that check was ran - (("$TESTS_RAN++")) + ((TESTS_RAN++)) fi else ####################################### @@ -391,14 +391,14 @@ function TestCodebase() # Increment the error count (("ERRORS_FOUND_$FILE_TYPE++")) # Increment counter that check was ran - (("$TESTS_RAN++")) + ((TESTS_RAN++)) else ########### # Success # ########### echo " - File:[$FILE_NAME] failed test case with [$LINTER_NAME] successfully" # Increment counter that check was ran - (("$TESTS_RAN++")) + ((TESTS_RAN++)) fi fi done