Merge pull request #59 from github/jwiebalk/jsonlint

Also check if GET_VERSION_CMD has been set
This commit is contained in:
Lukas Gravley 2020-02-03 07:53:20 -06:00 committed by GitHub
commit 8772b098a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,7 +164,7 @@ GetLinterVersions()
############################## ##############################
# Check the shell for errors # # Check the shell for errors #
############################## ##############################
if [ $ERROR_CODE -ne 0 ]; then if [ $ERROR_CODE -ne 0 ] | [ -z "${GET_VERSION_CMD[*]}" ]; then
echo "WARN! Failed to get version info for:[$LINTER]" echo "WARN! Failed to get version info for:[$LINTER]"
echo "---------------------------------------------" echo "---------------------------------------------"
else else
@ -434,7 +434,7 @@ LintJsonFiles()
LINTER_NAME="jsonlint" LINTER_NAME="jsonlint"
####################################### #######################################
# Validate we have yamllint installed # # Validate we have jsonlint installed #
####################################### #######################################
# shellcheck disable=SC2230 # shellcheck disable=SC2230
VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1)
@ -610,14 +610,6 @@ LintYmlFiles()
##################### #####################
FILE_NAME=$(basename "$FILE" 2>&1) FILE_NAME=$(basename "$FILE" 2>&1)
#######################################
# Make sure we dont lint node modules #
#######################################
# if [[ $FILE == *"node_modules"* ]]; then
# # This is a node modules file
# continue
# fi
############## ##############
# File print # # File print #
############## ##############
@ -673,9 +665,9 @@ LintXmlFiles()
###################### ######################
LINTER_NAME="xmllint" LINTER_NAME="xmllint"
####################################### ######################################
# Validate we have yamllint installed # # Validate we have xmllint installed #
####################################### ######################################
# shellcheck disable=SC2230 # shellcheck disable=SC2230
VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1)
@ -793,9 +785,9 @@ LintMdFiles()
###################### ######################
LINTER_NAME="markdownlint" LINTER_NAME="markdownlint"
####################################### ###########################################
# Validate we have yamllint installed # # Validate we have markdownlint installed #
####################################### ###########################################
# shellcheck disable=SC2230 # shellcheck disable=SC2230
VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1)
@ -2667,7 +2659,7 @@ Footer()
echo "ERRORS FOUND in YAML:[$ERRORS_FOUND_YML]" echo "ERRORS FOUND in YAML:[$ERRORS_FOUND_YML]"
echo "ERRORS FOUND in JSON:[$ERRORS_FOUND_JSON]" echo "ERRORS FOUND in JSON:[$ERRORS_FOUND_JSON]"
echo "ERRORS FOUND in XML:[$ERRORS_FOUND_XML]" echo "ERRORS FOUND in XML:[$ERRORS_FOUND_XML]"
echo "ERRORS FOUND IN MD:[$ERRORS_FOUND_MD]" echo "ERRORS FOUND in MD:[$ERRORS_FOUND_MD]"
echo "ERRORS FOUND in BASH:[$ERRORS_FOUND_BASH]" echo "ERRORS FOUND in BASH:[$ERRORS_FOUND_BASH]"
echo "ERRORS FOUND in PERL:[$ERRORS_FOUND_PERL]" echo "ERRORS FOUND in PERL:[$ERRORS_FOUND_PERL]"
echo "ERRORS FOUND in PYTHON:[$ERRORS_FOUND_PYTHON]" echo "ERRORS FOUND in PYTHON:[$ERRORS_FOUND_PYTHON]"