fixed more logic issues

This commit is contained in:
Lucas Gravley 2020-04-27 13:47:11 -05:00
parent 1c6d7364d2
commit 97c264ca8b

View file

@ -685,6 +685,11 @@ GetValidationInfo()
fi fi
fi fi
######################
# Create Print Array #
######################
PRINT_ARRAY=()
############################### ###############################
# Convert string to lowercase # # Convert string to lowercase #
############################### ###############################
@ -695,10 +700,10 @@ GetValidationInfo()
if [[ "$VALIDATE_YAML" != "false" ]]; then if [[ "$VALIDATE_YAML" != "false" ]]; then
# Set to true # Set to true
VALIDATE_YAML="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_YAML="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [YML] files in code base..." PRINT_ARRAY+=("- Validating [YML] files in code base...")
else else
# Its false # Its false
echo "- Excluding [YML] files in code base..." PRINT_ARRAY+=("- Excluding [YML] files in code base...")
fi fi
############################### ###############################
@ -711,10 +716,10 @@ GetValidationInfo()
if [[ "$VALIDATE_JSON" != "false" ]]; then if [[ "$VALIDATE_JSON" != "false" ]]; then
# Set to true # Set to true
VALIDATE_JSON="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_JSON="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [JSON] files in code base..." PRINT_ARRAY+=("- Validating [JSON] files in code base...")
else else
# Its false # Its false
echo "- Excluding [JSON] files in code base..." PRINT_ARRAY+=("- Excluding [JSON] files in code base...")
fi fi
############################### ###############################
@ -727,10 +732,10 @@ GetValidationInfo()
if [[ "$VALIDATE_XML" != "false" ]]; then if [[ "$VALIDATE_XML" != "false" ]]; then
# Set to true # Set to true
VALIDATE_XML="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_XML="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [XML] files in code base..." PRINT_ARRAY+=("- Validating [XML] files in code base...")
else else
# Its false # Its false
echo "- Excluding [XML] files in code base..." PRINT_ARRAY+=("- Excluding [XML] files in code base...")
fi fi
############################### ###############################
@ -743,10 +748,10 @@ GetValidationInfo()
if [[ "$VALIDATE_MD" != "false" ]]; then if [[ "$VALIDATE_MD" != "false" ]]; then
# Set to true # Set to true
VALIDATE_MD="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_MD="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [MARKDOWN] files in code base..." PRINT_ARRAY+=("- Validating [MARKDOWN] files in code base...")
else else
# Its false # Its false
echo "- Excluding [MARKDOWN] files in code base..." PRINT_ARRAY+=("- Excluding [MARKDOWN] files in code base...")
fi fi
############################### ###############################
@ -759,10 +764,10 @@ GetValidationInfo()
if [[ "$VALIDATE_BASH" != "false" ]]; then if [[ "$VALIDATE_BASH" != "false" ]]; then
# Set to true # Set to true
VALIDATE_BASH="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_BASH="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [BASH] files in code base..." PRINT_ARRAY+=("- Validating [BASH] files in code base...")
else else
# Its false # Its false
echo "- Excluding [BASH] files in code base..." PRINT_ARRAY+=("- Excluding [BASH] files in code base...")
fi fi
############################### ###############################
@ -775,10 +780,10 @@ GetValidationInfo()
if [[ "$VALIDATE_PERL" != "false" ]]; then if [[ "$VALIDATE_PERL" != "false" ]]; then
# Set to true # Set to true
VALIDATE_PERL="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_PERL="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [PERL] files in code base..." PRINT_ARRAY+=("- Validating [PERL] files in code base...")
else else
# Its false # Its false
echo "- Excluding [PERL] files in code base..." PRINT_ARRAY+=("- Excluding [PERL] files in code base...")
fi fi
############################### ###############################
@ -791,10 +796,10 @@ GetValidationInfo()
if [[ "$VALIDATE_PYTHON" != "false" ]]; then if [[ "$VALIDATE_PYTHON" != "false" ]]; then
# Set to true # Set to true
VALIDATE_PYTHON="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_PYTHON="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [PYTHON] files in code base..." PRINT_ARRAY+=("- Validating [PYTHON] files in code base...")
else else
# Its false # Its false
echo "- Excluding [PYTHON] files in code base..." PRINT_ARRAY+=("- Excluding [PYTHON] files in code base...")
fi fi
############################### ###############################
@ -807,10 +812,10 @@ GetValidationInfo()
if [[ "$VALIDATE_RUBY" != "false" ]]; then if [[ "$VALIDATE_RUBY" != "false" ]]; then
# Set to true # Set to true
VALIDATE_RUBY="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_RUBY="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [RUBY] files in code base..." PRINT_ARRAY+=("- Validating [RUBY] files in code base...")
else else
# Its false # Its false
echo "- Excluding [RUBY] files in code base..." PRINT_ARRAY+=("- Excluding [RUBY] files in code base...")
fi fi
############################### ###############################
@ -823,10 +828,10 @@ GetValidationInfo()
if [[ "$VALIDATE_COFFEE" != "false" ]]; then if [[ "$VALIDATE_COFFEE" != "false" ]]; then
# Set to true # Set to true
VALIDATE_COFFEE="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_COFFEE="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [COFFEE] files in code base..." PRINT_ARRAY+=("- Validating [COFFEE] files in code base...")
else else
# Its false # Its false
echo "- Excluding [COFFEE] files in code base..." PRINT_ARRAY+=("- Excluding [COFFEE] files in code base...")
fi fi
############################### ###############################
@ -839,10 +844,10 @@ GetValidationInfo()
if [[ "$VALIDATE_ANSIBLE" != "false" ]]; then if [[ "$VALIDATE_ANSIBLE" != "false" ]]; then
# Set to true # Set to true
VALIDATE_ANSIBLE="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_ANSIBLE="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [ANSIBLE] files in code base..." PRINT_ARRAY+=("- Validating [ANSIBLE] files in code base...")
else else
# Its false # Its false
echo "- Excluding [ANSIBLE] files in code base..." PRINT_ARRAY+=("- Excluding [ANSIBLE] files in code base...")
fi fi
############################### ###############################
@ -855,10 +860,10 @@ GetValidationInfo()
if [[ "$VALIDATE_JAVASCRIPT_ES" != "false" ]]; then if [[ "$VALIDATE_JAVASCRIPT_ES" != "false" ]]; then
# Set to true # Set to true
VALIDATE_JAVASCRIPT_ES="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_JAVASCRIPT_ES="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [JAVASCRIPT(eslint)] files in code base..." PRINT_ARRAY+=("- Validating [JAVASCRIPT(eslint)] files in code base...")
else else
# Its false # Its false
echo "- Excluding [JAVASCRIPT(eslint)] files in code base..." PRINT_ARRAY+=("- Excluding [JAVASCRIPT(eslint)] files in code base...")
fi fi
############################### ###############################
@ -871,10 +876,10 @@ GetValidationInfo()
if [[ "$VALIDATE_JAVASCRIPT_STANDARD" != "false" ]]; then if [[ "$VALIDATE_JAVASCRIPT_STANDARD" != "false" ]]; then
# Set to true # Set to true
VALIDATE_JAVASCRIPT_STANDARD="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_JAVASCRIPT_STANDARD="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [JAVASCRIPT(standard)] files in code base..." PRINT_ARRAY+=("- Validating [JAVASCRIPT(standard)] files in code base...")
else else
# Its false # Its false
echo "- Excluding [JAVASCRIPT(standard)] files in code base..." PRINT_ARRAY+=("- Excluding [JAVASCRIPT(standard)] files in code base...")
fi fi
############################### ###############################
@ -887,10 +892,10 @@ GetValidationInfo()
if [[ "$VALIDATE_TYPESCRIPT_ES" != "false" ]]; then if [[ "$VALIDATE_TYPESCRIPT_ES" != "false" ]]; then
# Set to true # Set to true
VALIDATE_TYPESCRIPT_ES="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_TYPESCRIPT_ES="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [TYPESCRIPT(eslint)] files in code base..." PRINT_ARRAY+=("- Validating [TYPESCRIPT(eslint)] files in code base...")
else else
# Its false # Its false
echo "- Excluding [TYPESCRIPT(eslint)] files in code base..." PRINT_ARRAY+=("- Excluding [TYPESCRIPT(eslint)] files in code base...")
fi fi
############################### ###############################
@ -903,10 +908,10 @@ GetValidationInfo()
if [[ "$VALIDATE_TYPESCRIPT_STANDARD" != "false" ]]; then if [[ "$VALIDATE_TYPESCRIPT_STANDARD" != "false" ]]; then
# Set to true # Set to true
VALIDATE_TYPESCRIPT_STANDARD="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_TYPESCRIPT_STANDARD="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [TYPESCRIPT(standard)] files in code base..." PRINT_ARRAY+=("- Validating [TYPESCRIPT(standard)] files in code base...")
else else
# Its false # Its false
echo "- Excluding [TYPESCRIPT(standard)] files in code base..." PRINT_ARRAY+=("- Excluding [TYPESCRIPT(standard)] files in code base...")
fi fi
############################### ###############################
@ -919,10 +924,10 @@ GetValidationInfo()
if [[ "$VALIDATE_DOCKER" != "false" ]]; then if [[ "$VALIDATE_DOCKER" != "false" ]]; then
# Set to true # Set to true
VALIDATE_DOCKER="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_DOCKER="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [DOCKER] files in code base..." PRINT_ARRAY+=("- Validating [DOCKER] files in code base...")
else else
# Its false # Its false
echo "- Excluding [DOCKER] files in code base..." PRINT_ARRAY+=("- Excluding [DOCKER] files in code base...")
fi fi
############################### ###############################
@ -935,10 +940,10 @@ GetValidationInfo()
if [[ "$VALIDATE_GO" != "false" ]]; then if [[ "$VALIDATE_GO" != "false" ]]; then
# Set to true # Set to true
VALIDATE_GO="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_GO="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [GOLANG] files in code base..." PRINT_ARRAY+=("- Validating [GOLANG] files in code base...")
else else
# Its false # Its false
echo "- Excluding [GOLANG] files in code base..." PRINT_ARRAY+=("- Excluding [GOLANG] files in code base...")
fi fi
############################### ###############################
@ -951,10 +956,10 @@ GetValidationInfo()
if [[ "$VALIDATE_TERRAFORM" != "false" ]]; then if [[ "$VALIDATE_TERRAFORM" != "false" ]]; then
# Set to true # Set to true
VALIDATE_TERRAFORM="$DEFAULT_VALIDATE_LANGUAGE" VALIDATE_TERRAFORM="$DEFAULT_VALIDATE_LANGUAGE"
echo "- Validating [TERRAFORM] files in code base..." PRINT_ARRAY+=("- Validating [TERRAFORM] files in code base...")
else else
# Its false # Its false
echo "- Excluding [TERRAFORM] files in code base..." PRINT_ARRAY+=("- Excluding [TERRAFORM] files in code base...")
fi fi
############################## ##############################
@ -1001,7 +1006,15 @@ GetValidationInfo()
# Debug on runner # # Debug on runner #
################### ###################
if [[ "$ACTIONS_RUNNER_DEBUG" == "true" ]]; then if [[ "$ACTIONS_RUNNER_DEBUG" == "true" ]]; then
echo "--- DEBUG ---" ###########################
# Print the validate info #
###########################
for LINE in "${PRINT_ARRAY[@]}"
do
echo "$LINE"
done
echo "--- DEBUG INFO ---"
echo "---------------------------------------------" echo "---------------------------------------------"
RUNNER=$(whoami) RUNNER=$(whoami)
echo "Runner:[$RUNNER]" echo "Runner:[$RUNNER]"
@ -1828,10 +1841,7 @@ GetGitHubVars
########################################## ##########################################
# Get the langugages we need to validate # # Get the langugages we need to validate #
########################################## ##########################################
if [[ "$ACTIONS_RUNNER_DEBUG" == "true" ]]; then GetValidationInfo
# Get the flags for langugaes to validate
GetValidationInfo
fi
######################## ########################
# Get the linter rules # # Get the linter rules #