mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-23 07:42:13 -05:00
adding cloud formation
This commit is contained in:
parent
3e895e123b
commit
5d3c4a99c1
2 changed files with 32 additions and 10 deletions
|
@ -100,18 +100,26 @@ function BuildFileList()
|
||||||
#echo "FILE_TYPE:[$FILE_TYPE]"
|
#echo "FILE_TYPE:[$FILE_TYPE]"
|
||||||
|
|
||||||
#####################
|
#####################
|
||||||
# Get the YML files #
|
# Get the CFN files #
|
||||||
#####################
|
#####################
|
||||||
if [ "$FILE_TYPE" == "yml" ] || [ "$FILE_TYPE" == "yaml" ]; then
|
if [ "$FILE_TYPE" == "json" ] || [ "$FILE_TYPE" == "yml" ] || [ "$FILE_TYPE" == "yaml" ] && DetectCloudFormationFile "$FILE"; then
|
||||||
################################
|
################################
|
||||||
# Append the file to the array #
|
# Append the file to the array #
|
||||||
################################
|
################################
|
||||||
FILE_ARRAY_YML+=("$FILE")
|
FILE_ARRAY_CFN+=("$FILE")
|
||||||
############################
|
##########################################################
|
||||||
# Check if file is OpenAPI #
|
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||||
############################
|
##########################################################
|
||||||
if DetectOpenAPIFile "$FILE"; then
|
READ_ONLY_CHANGE_FLAG=1
|
||||||
FILE_ARRAY_OPENAPI+=("$FILE")
|
|
||||||
|
#####################################
|
||||||
|
# Check if the file is CFN template #
|
||||||
|
#####################################
|
||||||
|
if DetectCloudFormationFile "$FILE"; then
|
||||||
|
################################
|
||||||
|
# Append the file to the array #
|
||||||
|
################################
|
||||||
|
FILE_ARRAY_CFN+=("$FILE")
|
||||||
fi
|
fi
|
||||||
##########################################################
|
##########################################################
|
||||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||||
|
@ -129,8 +137,21 @@ function BuildFileList()
|
||||||
# Check if file is OpenAPI #
|
# Check if file is OpenAPI #
|
||||||
############################
|
############################
|
||||||
if DetectOpenAPIFile "$FILE"; then
|
if DetectOpenAPIFile "$FILE"; then
|
||||||
|
################################
|
||||||
|
# Append the file to the array #
|
||||||
|
################################
|
||||||
FILE_ARRAY_OPENAPI+=("$FILE")
|
FILE_ARRAY_OPENAPI+=("$FILE")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Check if the file is CFN template #
|
||||||
|
#####################################
|
||||||
|
if DetectCloudFormationFile "$FILE"; then
|
||||||
|
################################
|
||||||
|
# Append the file to the array #
|
||||||
|
################################
|
||||||
|
FILE_ARRAY_CFN+=("$FILE")
|
||||||
|
fi
|
||||||
##########################################################
|
##########################################################
|
||||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||||
##########################################################
|
##########################################################
|
||||||
|
|
|
@ -450,11 +450,11 @@ DetectOpenAPIFile()
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
################################################################################
|
||||||
#### Function DetectCloudFormationFile #########################################
|
#### Function DetectCloudFormationFile #########################################
|
||||||
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html
|
|
||||||
DetectCloudFormationFile()
|
DetectCloudFormationFile()
|
||||||
{
|
{
|
||||||
|
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html
|
||||||
# AWSTemplateFormatVersion is optional
|
# AWSTemplateFormatVersion is optional
|
||||||
if grep 'AWSTemplateFormatVersion' "${1}" > /dev/null; then
|
if grep 'AWSTemplateFormatVersion' "${1}" > /dev/null; then
|
||||||
return 0
|
return 0
|
||||||
|
@ -677,6 +677,7 @@ Footer()
|
||||||
[ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || \
|
[ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || \
|
||||||
[ "$ERRORS_FOUND_RUBY" -ne 0 ] || \
|
[ "$ERRORS_FOUND_RUBY" -ne 0 ] || \
|
||||||
[ "$ERRORS_FOUND_CSS" -ne 0 ] || \
|
[ "$ERRORS_FOUND_CSS" -ne 0 ] || \
|
||||||
|
[ "$ERRORS_FOUND_CFN" -ne 0 ] || \
|
||||||
[ "$ERRORS_FOUND_ENV" -ne 0 ] || \
|
[ "$ERRORS_FOUND_ENV" -ne 0 ] || \
|
||||||
[ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || \
|
[ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || \
|
||||||
[ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || \
|
[ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || \
|
||||||
|
|
Loading…
Reference in a new issue