From c681b09ebeb1e767c26619b290cbcb41d053613f Mon Sep 17 00:00:00 2001 From: Brett Logan Date: Mon, 9 Jan 2023 00:10:46 -0500 Subject: [PATCH] Specify version flag for kubeconform Signed-off-by: Brett Logan --- lib/functions/linterVersions.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/functions/linterVersions.sh b/lib/functions/linterVersions.sh index 62e661b3..fd97d442 100755 --- a/lib/functions/linterVersions.sh +++ b/lib/functions/linterVersions.sh @@ -75,24 +75,26 @@ BuildLinterVersions() { elif [[ ${LINTER} == "bash-exec" ]] || [[ ${LINTER} == "gherkin-lint" ]] || [[ ${LINTER} == "asl-validator" ]]; then # Need specific command for Protolint and editorconfig-checker GET_VERSION_CMD="$(echo "--version not supported")" + elif [[ ${LINTER} == "checkstyle" ]] || [[ ${LINTER} == "google-java-format" ]]; then + GET_VERSION_CMD="$(java -jar "/usr/bin/${LINTER}" --version 2>&1)" + elif [[ ${LINTER} == "clippy" ]]; then + GET_VERSION_CMD="$(cargo-clippy --version 2>&1)" + elif [[ ${LINTER} == "editorconfig-checker" ]]; then + GET_VERSION_CMD="$(${LINTER} -version)" + elif [[ ${LINTER} == "kubeconform" ]]; then + GET_VERSION_CMD="$(${LINTER} -v)" elif [[ ${LINTER} == "lintr" ]]; then # Need specific command for lintr (--slave is deprecated in R 4.0 and replaced by --no-echo) 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} == "protolint" ]] || [[ ${LINTER} == "gitleaks" ]]; then + GET_VERSION_CMD="$(${LINTER} version)" elif [[ ${LINTER} == "lua" ]]; then # Semi standardversion command GET_VERSION_CMD="$("${LINTER}" -v 2>&1)" elif [[ ${LINTER} == "terrascan" ]]; then GET_VERSION_CMD="$("${LINTER}" version 2>&1)" - elif [[ ${LINTER} == "checkstyle" ]] || [[ ${LINTER} == "google-java-format" ]]; then - GET_VERSION_CMD="$(java -jar "/usr/bin/${LINTER}" --version 2>&1)" - elif [[ ${LINTER} == "clippy" ]]; then - GET_VERSION_CMD="$(cargo-clippy --version 2>&1)" - elif [[ ${LINTER} == "protolint" ]] || [[ ${LINTER} == "gitleaks" ]]; then - GET_VERSION_CMD="$(${LINTER} version)" - elif [[ ${LINTER} == "editorconfig-checker" ]]; then - GET_VERSION_CMD="$(${LINTER} -version)" else # Standard version command GET_VERSION_CMD="$("${LINTER}" --version 2>&1)"