From d9bf945fd2655f151a6768a3324716599059108e Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Wed, 14 Aug 2024 17:26:55 +0200 Subject: [PATCH] chore: remove file_array leftovers (#6018) Remove the initialization of FILE_ARRAY_xxx variables because worker.sh dynamically initializes them already. --- lib/functions/buildFileList.sh | 2 -- lib/functions/worker.sh | 1 + lib/linter.sh | 9 --------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/functions/buildFileList.sh b/lib/functions/buildFileList.sh index c8434917..720825fd 100755 --- a/lib/functions/buildFileList.sh +++ b/lib/functions/buildFileList.sh @@ -343,7 +343,6 @@ BuildFileArrays() { elif [ "${FILE_TYPE}" == "coffee" ]; then echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-COFFEESCRIPT" elif [ "${FILE_TYPE}" == "cs" ]; then - FILE_ARRAY_CSHARP+=("${FILE}") echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-CSHARP" elif [ "${FILE_TYPE}" == "css" ] || [ "${FILE_TYPE}" == "scss" ] || [ "${FILE_TYPE}" == "sass" ]; then @@ -413,7 +412,6 @@ BuildFileArrays() { elif [ "$FILE_TYPE" == "jsonc" ] || [ "$FILE_TYPE" == "json5" ]; then echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JSONC" elif [ "${FILE_TYPE}" == "json" ]; then - FILE_ARRAY_JSON+=("${FILE}") echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-JSON" if DetectOpenAPIFile "${FILE}"; then echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-OPENAPI" diff --git a/lib/functions/worker.sh b/lib/functions/worker.sh index e730f91a..2070d327 100755 --- a/lib/functions/worker.sh +++ b/lib/functions/worker.sh @@ -37,6 +37,7 @@ function LintCodebase() { local -n FILE_ARRAY="FILE_ARRAY_${FILE_TYPE}" local FILE_ARRAY_LANGUAGE_PATH="${FILE_ARRAYS_DIRECTORY_PATH}/file-array-${FILE_TYPE}" if [[ -e "${FILE_ARRAY_LANGUAGE_PATH}" ]]; then + FILE_ARRAY=() while read -r FILE; do if [[ "${TEST_CASE_RUN}" == "true" ]]; then debug "Ensure that the list files to check for ${FILE_TYPE} doesn't include test cases for other languages" diff --git a/lib/linter.sh b/lib/linter.sh index a62ade59..224fafc4 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -180,15 +180,6 @@ source /action/lib/globals/linterRules.sh # shellcheck source=/dev/null source /action/lib/globals/languages.sh -########################## -# Array of changed files # -########################## -for LANGUAGE in "${LANGUAGE_ARRAY[@]}"; do - FILE_ARRAY_VARIABLE_NAME="FILE_ARRAY_${LANGUAGE}" - debug "Initializing ${FILE_ARRAY_VARIABLE_NAME}" - eval "${FILE_ARRAY_VARIABLE_NAME}=()" -done - Header() { if [[ "${SUPPRESS_POSSUM}" == "false" ]]; then info "$(/bin/bash /action/lib/functions/possum.sh)"