added config parameter

This commit is contained in:
Matthias Meyer 2020-07-07 17:02:56 +02:00
parent 9f7cb36b5c
commit f381c47e22
No known key found for this signature in database
GPG key ID: FE9E2B54F6B9DEC3
2 changed files with 61 additions and 4 deletions

View file

@ -273,7 +273,7 @@ function BuildFileList() {
############################
# Get the JavaScript files #
############################
elif [ "$FILE_TYPE" == "js" ] || [ "$FILE_TYPE" == "jsx" ]; then
elif [ "$FILE_TYPE" == "js" ]; then
################################
# Append the file to the array #
################################
@ -284,9 +284,36 @@ function BuildFileList() {
##########################################################
READ_ONLY_CHANGE_FLAG=1
############################
# Get the JSX files #
############################
elif [ "$FILE_TYPE" == "jsx" ]; then
################################
# Append the file to the array #
################################
FILE_ARRAY_JSX+=("$FILE")
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
############################
# Get the TSX files #
############################
elif [ "$FILE_TYPE" == "tsx" ]; then
################################
# Append the file to the array #
################################
FILE_ARRAY_TSX+=("$FILE")
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
########################
# Get the Golang files #
########################
############################
# Get the TypeScript files #
############################
elif [ "$FILE_TYPE" == "ts" ] || [ "$FILE_TYPE" == "tsx" ]; then
elif [ "$FILE_TYPE" == "ts" ]; then
################################
# Append the file to the array #
################################

View file

@ -191,6 +191,8 @@ FILE_ARRAY_CFN=() # Array of files to check
FILE_ARRAY_COFFEESCRIPT=() # Array of files to check
FILE_ARRAY_JAVASCRIPT_ES=() # Array of files to check
FILE_ARRAY_JAVASCRIPT_STANDARD=() # Array of files to check
FILE_ARRAY_JSX=() # Array of files to check
FILE_ARRAY_TSX=() # Array of files to check
FILE_ARRAY_TYPESCRIPT_ES=() # Array of files to check
FILE_ARRAY_TYPESCRIPT_STANDARD=() # Array of files to check
FILE_ARRAY_DOCKER=() # Array of files to check
@ -781,6 +783,8 @@ Footer() {
[ "$ERRORS_FOUND_ANSIBLE" -ne 0 ] ||
[ "$ERRORS_FOUND_JAVASCRIPT_ES" -ne 0 ] ||
[ "$ERRORS_FOUND_JAVASCRIPT_STANDARD" -ne 0 ] ||
[ "$ERRORS_FOUND_JSX" -ne 0 ] ||
[ "$ERRORS_FOUND_TSX" -ne 0 ] ||
[ "$ERRORS_FOUND_TYPESCRIPT_ES" -ne 0 ] ||
[ "$ERRORS_FOUND_TYPESCRIPT_STANDARD" -ne 0 ] ||
[ "$ERRORS_FOUND_DOCKER" -ne 0 ] ||
@ -1080,7 +1084,7 @@ if [ "$VALIDATE_JAVASCRIPT_ES" == "true" ]; then
# Lint the Javascript files #
#############################
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
LintCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(jsx\?\)\$" "${FILE_ARRAY_JAVASCRIPT_ES[@]}"
LintCodebase "JAVASCRIPT_ES" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_ES[@]}"
fi
######################
@ -1098,6 +1102,32 @@ if [ "$VALIDATE_JAVASCRIPT_STANDARD" == "true" ]; then
LintCodebase "JAVASCRIPT_STANDARD" "standard" "standard $JAVASCRIPT_STANDARD_LINTER_RULES" ".*\.\(js\)\$" "${FILE_ARRAY_JAVASCRIPT_STANDARD[@]}"
fi
######################
# JSX LINTING #
######################
if [ "$VALIDATE_JSX" == "true" ]; then
#############################
# Lint the JSX files #
#############################
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
LintCodebase "JSX" "eslint" "eslint --no-eslintrc -c $JAVASCRIPT_LINTER_RULES" ".*\.\(jsx\)\$" "${FILE_ARRAY_JSX[@]}"
fi
######################
# TSX LINTING #
######################
if [ "$VALIDATE_TSX" == "true" ]; then
#################################
# Get Typescript standard rules #
#################################
GetStandardRules "typescript"
#############################
# Lint the TSX files #
#############################
LintCodebase "TSX" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(tsx\)\$" "${FILE_ARRAY_TSX[@]}"
fi
######################
# TYPESCRIPT LINTING #
######################
@ -1105,7 +1135,7 @@ if [ "$VALIDATE_TYPESCRIPT_ES" == "true" ]; then
#############################
# Lint the Typescript files #
#############################
LintCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(tsx\?\)\$" "${FILE_ARRAY_TYPESCRIPT_ES[@]}"
LintCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c $TYPESCRIPT_LINTER_RULES" ".*\.\(ts\)\$" "${FILE_ARRAY_TYPESCRIPT_ES[@]}"
fi
######################