From 3fda83377a07eea0c03a3f1023f4c80de01c7954 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 24 Aug 2020 13:56:09 -0500 Subject: [PATCH 1/4] add quotes --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index b642d8f1..feda168f 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1108,7 +1108,7 @@ Footer() { ###################################### # Check if we validated the langauge # ###################################### - elif [[ ${!ERROR_COUNTER} -eq 0 ]] && [[ ${UNIQUE_LINTED_ARRAY[*]} =~ ${LANGUAGE} ]]; then + elif [[ ${!ERROR_COUNTER} -eq 0 ]] && [[ " ${UNIQUE_LINTED_ARRAY[*]} " =~ " ${LANGUAGE} " ]]; then # No errors found when linting the language CallStatusAPI "${LANGUAGE}" "success" fi From 254db11e0864a856b3536f89ddb0d6b33c80cd7d Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 24 Aug 2020 14:12:37 -0500 Subject: [PATCH 2/4] better... faster... stronger... --- lib/linter.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index feda168f..2e71f4f6 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1108,7 +1108,8 @@ Footer() { ###################################### # Check if we validated the langauge # ###################################### - elif [[ ${!ERROR_COUNTER} -eq 0 ]] && [[ " ${UNIQUE_LINTED_ARRAY[*]} " =~ " ${LANGUAGE} " ]]; then + elif [[ ${!ERROR_COUNTER} -eq 0 ]]; then + if CheckInArray "${LANGUAGE}"; then # No errors found when linting the language CallStatusAPI "${LANGUAGE}" "success" fi @@ -1144,7 +1145,31 @@ Footer() { # Successful exit exit 0 } +################################################################################ +#### Function CheckInArray ##################################################### +CheckInArray() { + ############### + # Pull in Var # + ############### + NEEDLE="$1" # Language we need to match + ###################################### + # Check if Language was in the array # + ###################################### + for LANG in "${UNIQUE_LINTED_ARRAY[@]}"; do + if [[ "${LANG}" == "${NEEDLE}" ]]; then + ############ + # Found it # + ############ + return 0 + fi + done + + ################### + # Did not find it # + ################### + return 1 +} ################################################################################ #### Function Cleanup ########################################################## cleanup() { From a1f76a8e2b18edec475e94b13082d7b5bb4b7aea Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 24 Aug 2020 14:17:44 -0500 Subject: [PATCH 3/4] fix version --- lib/linter.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/linter.sh b/lib/linter.sh index 2e71f4f6..f4540916 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -465,6 +465,9 @@ GetLinterVersions() { mapfile -t GET_VERSION_CMD < <(R --slave -e "r_ver <- R.Version()\$version.string; \ lintr_ver <- packageVersion('lintr'); \ glue::glue('lintr { lintr_ver } on { r_ver }')") + elif [[ ${LINTER} == "lua" ]]; then + # Semi standardversion command + mapfile -t GET_VERSION_CMD < <("${LINTER}" -v 2>&1) else # Standard version command mapfile -t GET_VERSION_CMD < <("${LINTER}" --version 2>&1) From e7ff2d0e66578f385204773866c5adc045e517c0 Mon Sep 17 00:00:00 2001 From: Lucas Gravley <29484535+admiralAwkbar@users.noreply.github.com> Date: Mon, 24 Aug 2020 14:22:39 -0500 Subject: [PATCH 4/4] fixed it --- lib/linter.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index f4540916..1475c8f6 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -1069,7 +1069,6 @@ Reports() { for TEST in "${WARNING_ARRAY_TEST[@]}"; do warn "Expected file to compare with was not found for ${TEST}" done - } ################################################################################ #### Function Footer ########################################################### @@ -1116,6 +1115,7 @@ Footer() { # No errors found when linting the language CallStatusAPI "${LANGUAGE}" "success" fi + fi done ################################## @@ -1184,7 +1184,6 @@ cleanup() { trap - 0 1 2 3 6 14 15 } trap 'cleanup' 0 1 2 3 6 14 15 - ################################################################################ ############################### MAIN ########################################### ################################################################################