maybe this does it

This commit is contained in:
Lucas Gravley 2020-07-21 08:12:28 -05:00
parent 195f67e165
commit 1fe8fb5431
2 changed files with 18 additions and 15 deletions

View file

@ -99,11 +99,16 @@ LINTER_ARRAY=("jsonlint" "yamllint" "xmllint" "markdownlint" "shellcheck"
############################# #############################
# Language array for prints # # Language array for prints #
############################# #############################
LANGUAGE_ARRAY=('YML' 'JSON' 'XML' 'MARKDOWN' 'BASH' 'PERL' 'RAKU' 'PHP' 'RUBY' 'PYTHON' LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CFN' 'CLOJURE' 'COFFEESCRIPT'
'COFFEESCRIPT' 'ANSIBLE' 'JAVASCRIPT_STANDARD' 'JAVASCRIPT_ES' 'JSX' 'TSX' 'CSS' 'DART' 'DOCKER' 'ENV' 'GO' 'HTML'
'TYPESCRIPT_STANDARD' 'TYPESCRIPT_ES' 'DOCKER' 'GO' 'TERRAFORM' 'JAVASCRIPT_ES' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'OPENAPI'
'CSS' 'ENV' 'POWERSHELL' 'ARM' 'KOTLIN' 'PROTOBUF' 'CLOJURE' 'OPENAPI' 'MARKDOWN' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' 'RAKU' 'RUBY'
'CFN' 'DART' 'HTML') 'TERRAFORM' 'TSX' 'TYPESCRIPT_ES' 'TYPESCRIPT_STANDARD' 'XML' 'YML' )
############################################
# Array for all languages that were linted #
############################################
LINTED_LANGUAGES_ARRAY=() # Will be filled at run time with all languages that were linted
################### ###################
# GitHub ENV Vars # # GitHub ENV Vars #
@ -879,8 +884,7 @@ Footer() {
# Print if not 0 # # Print if not 0 #
################## ##################
if [ "${!ERROR_COUNTER}" -ne 0 ]; then if [ "${!ERROR_COUNTER}" -ne 0 ]; then
# We found errors # We found errors in the language
################### ###################
# Print the goods # # Print the goods #
################### ###################
@ -891,17 +895,11 @@ Footer() {
######################################### #########################################
CallStatusAPI "$LANGUAGE" "error" CallStatusAPI "$LANGUAGE" "error"
else else
# No errors found # No errors found when linting the language
###############################################
# Create Validate language var from Var input #
###############################################
VALIDATE_LANGUAGE_ARRAY="FILE_ARRAY_${LANGUAGE}"
###################################### ######################################
# Check if we validated the langauge # # Check if we validated the langauge #
###################################### ######################################
if [ "${#!VALIDATE_LANGUAGE_ARRAY[@]}" -gt 0 ]; then if [[ "${LINTED_LANGUAGES_ARRAY[@]}" =~ "${LANGUAGE}" ]]; then
CallStatusAPI "$LANGUAGE" "success" CallStatusAPI "$LANGUAGE" "success"
fi fi
fi fi

View file

@ -34,6 +34,11 @@ function LintCodebase() {
PRINT_ARRAY+=("----------------------------------------------") PRINT_ARRAY+=("----------------------------------------------")
PRINT_ARRAY+=("----------------------------------------------") PRINT_ARRAY+=("----------------------------------------------")
#################################
# Add the language to the array #
#################################
LINTED_LANGUAGES_ARRAY+=("$FILE_TYPE")
##################################### #####################################
# Validate we have linter installed # # Validate we have linter installed #
##################################### #####################################