From cfd813cbda0f36ec289d81c2b0f2eae9221e7168 Mon Sep 17 00:00:00 2001 From: John Wiebalk Date: Fri, 31 Jan 2020 17:52:28 -0500 Subject: [PATCH 1/6] check if version is returned --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 632ab8d3..19fbd06e 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -157,7 +157,7 @@ GetLinterVersions() ############################## # 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 "---------------------------------------------" else @@ -399,7 +399,7 @@ LintJsonFiles() LINTER_NAME="jsonlint" ####################################### - # Validate we have yamllint installed # + # Validate we have jsonlint installed # ####################################### # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) From 29c9470bb1e82df09a373afaa8a38bf6d1136457 Mon Sep 17 00:00:00 2001 From: John Wiebalk Date: Fri, 31 Jan 2020 17:55:01 -0500 Subject: [PATCH 2/6] remove quotes --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index 19fbd06e..ca315691 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -157,7 +157,7 @@ GetLinterVersions() ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ] | [ -z "$GET_VERSION_CMD" ]; then + if [ $ERROR_CODE -ne 0 ] | [ -z $GET_VERSION_CMD ]; then echo "WARN! Failed to get version info for:[$LINTER]" echo "---------------------------------------------" else From 916f5fe1eda7cdc4f9455161de5c052922001b0b Mon Sep 17 00:00:00 2001 From: John Wiebalk Date: Fri, 31 Jan 2020 18:00:28 -0500 Subject: [PATCH 3/6] is it really an array? --- lib/linter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter.sh b/lib/linter.sh index ca315691..d42476f7 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -157,7 +157,7 @@ GetLinterVersions() ############################## # Check the shell for errors # ############################## - if [ $ERROR_CODE -ne 0 ] | [ -z $GET_VERSION_CMD ]; then + if [ $ERROR_CODE -ne 0 ] | [ -z "${GET_VERSION_CMD[*]}" ]; then echo "WARN! Failed to get version info for:[$LINTER]" echo "---------------------------------------------" else From 2182df6459b837929c958c9c3d99c6521fb1eaae Mon Sep 17 00:00:00 2001 From: John Wiebalk Date: Fri, 31 Jan 2020 18:19:10 -0500 Subject: [PATCH 4/6] fix comments --- lib/linter.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index d42476f7..53989739 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -639,7 +639,7 @@ LintXmlFiles() LINTER_NAME="xmllint" ####################################### - # Validate we have yamllint installed # + # Validate we have xmllint installed # ####################################### # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) @@ -758,9 +758,9 @@ LintMdFiles() ###################### LINTER_NAME="markdownlint" - ####################################### - # Validate we have yamllint installed # - ####################################### + ########################################### + # Validate we have markdownlint installed # + ########################################### # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) From b282b1fce238db9fc5358b86777b897d1f180acc Mon Sep 17 00:00:00 2001 From: John Wiebalk Date: Fri, 31 Jan 2020 18:20:03 -0500 Subject: [PATCH 5/6] fix # --- lib/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 53989739..9a90c447 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -638,9 +638,9 @@ LintXmlFiles() ###################### LINTER_NAME="xmllint" - ####################################### + ###################################### # Validate we have xmllint installed # - ####################################### + ###################################### # shellcheck disable=SC2230 VALIDATE_INSTALL_CMD=$(command -v "$LINTER_NAME" 2>&1) From c3932a6031539e1759f88e75337aa01e3fa57fad Mon Sep 17 00:00:00 2001 From: John Wiebalk Date: Fri, 31 Jan 2020 18:26:57 -0500 Subject: [PATCH 6/6] cleanup --- lib/linter.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 9a90c447..f7cfceb1 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -575,14 +575,6 @@ LintYmlFiles() ##################### 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 # ############## @@ -2492,7 +2484,7 @@ Footer() echo "ERRORS FOUND in YAML:[$ERRORS_FOUND_YML]" echo "ERRORS FOUND in JSON:[$ERRORS_FOUND_JSON]" 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 PERL:[$ERRORS_FOUND_PERL]" echo "ERRORS FOUND in PYTHON:[$ERRORS_FOUND_PYTHON]"