Cleanup footer prints

This commit is contained in:
Lucas Gravley 2020-04-27 14:13:12 -05:00
parent 97c264ca8b
commit c6f74369b8

View file

@ -55,6 +55,13 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck"
"pylint" "perl" "rubocop" "coffeelint" "eslint" "standard" "pylint" "perl" "rubocop" "coffeelint" "eslint" "standard"
"ansible-lint" "/dockerfilelint/bin/dockerfilelint" "golangci-lint" "tflint") "ansible-lint" "/dockerfilelint/bin/dockerfilelint" "golangci-lint" "tflint")
#############################
# Language array for prints #
#############################
LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RUBY' 'PYTHON'
'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES'
'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM')
################### ###################
# GitHub ENV Vars # # GitHub ENV Vars #
################### ###################
@ -1440,10 +1447,20 @@ LintCodebase()
# Set it back to empty if loaded with blanks from scanning # # Set it back to empty if loaded with blanks from scanning #
############################################################ ############################################################
if [ ${#LIST_FILES[@]} -lt 1 ]; then if [ ${#LIST_FILES[@]} -lt 1 ]; then
######################
# Set to empty array #
######################
LIST_FILES=() LIST_FILES=()
#############################
# Skip as we found no files #
#############################
SKIP_FLAG=1
fi fi
fi fi
###############################
# Check if any data was found #
###############################
if [ $SKIP_FLAG -eq 0 ]; then if [ $SKIP_FLAG -eq 0 ]; then
###################### ######################
# Print Header array # # Print Header array #
@ -1724,23 +1741,29 @@ Footer()
echo "----------------------------------------------" echo "----------------------------------------------"
echo "----------------------------------------------" echo "----------------------------------------------"
echo "" echo ""
echo "ERRORS FOUND in YAML:[$ERRORS_FOUND_YML]"
echo "ERRORS FOUND in JSON:[$ERRORS_FOUND_JSON]" ##############################
echo "ERRORS FOUND in XML:[$ERRORS_FOUND_XML]" # Prints for errors if found #
echo "ERRORS FOUND in MARKDOWN:[$ERRORS_FOUND_MARKDOWN]" ##############################
echo "ERRORS FOUND in BASH:[$ERRORS_FOUND_BASH]" for LANGUAGE in "${LANGUAGE_ARRAY[@]}"
echo "ERRORS FOUND in PERL:[$ERRORS_FOUND_PERL]" do
echo "ERRORS FOUND in PYTHON:[$ERRORS_FOUND_PYTHON]" ###########################
echo "ERRORS FOUND in COFFEESCRIPT:[$ERRORS_FOUND_COFFEESCRIPT]" # Build the error counter #
echo "ERRORS FOUND in RUBY:[$ERRORS_FOUND_RUBY]" ###########################
echo "ERRORS FOUND in ANSIBLE:[$ERRORS_FOUND_ANSIBLE]" ERROR_COUNTER="ERRORS_FOUND_$LANGUAGE"
echo "ERRORS FOUND in JAVASCRIPT(eslint):[$ERRORS_FOUND_JAVASCRIPT_ES]"
echo "ERRORS FOUND in JAVASCRIPT(Standard):[$ERRORS_FOUND_JAVASCRIPT_STANDARD]" ##################
echo "ERRORS FOUND in TYPESCRIPT(eslint):[$ERRORS_FOUND_TYPESCRIPT_ES]" # Print if not 0 #
echo "ERRORS FOUND in TYPESCRIPT(Standard):[$ERRORS_FOUND_TYPESCRIPT_STANDARD]" ##################
echo "ERRORS FOUND in DOCKER:[$ERRORS_FOUND_DOCKER]" if [ "$ERROR_COUNTER" -ne 0 ]; then
echo "ERRORS FOUND in GO:[$ERRORS_FOUND_GO]" # Print the goods
echo "ERRORS FOUND in TERRAFORM:[$ERRORS_FOUND_TERRAFORM]" echo "ERRORS FOUND in $LANGUAGE:[$ERROR_COUNTER]"
fi
done
#################
# Footer prints #
#################
echo "" echo ""
echo "----------------------------------------------" echo "----------------------------------------------"
echo "" echo ""