mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 14:10:56 -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]"
|
||||
|
||||
#####################
|
||||
# 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 #
|
||||
################################
|
||||
FILE_ARRAY_YML+=("$FILE")
|
||||
############################
|
||||
# Check if file is OpenAPI #
|
||||
############################
|
||||
if DetectOpenAPIFile "$FILE"; then
|
||||
FILE_ARRAY_OPENAPI+=("$FILE")
|
||||
FILE_ARRAY_CFN+=("$FILE")
|
||||
##########################################################
|
||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||
##########################################################
|
||||
READ_ONLY_CHANGE_FLAG=1
|
||||
|
||||
#####################################
|
||||
# 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 #
|
||||
|
@ -129,8 +137,21 @@ function BuildFileList()
|
|||
# Check if file is OpenAPI #
|
||||
############################
|
||||
if DetectOpenAPIFile "$FILE"; then
|
||||
################################
|
||||
# Append the file to the array #
|
||||
################################
|
||||
FILE_ARRAY_OPENAPI+=("$FILE")
|
||||
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 #
|
||||
##########################################################
|
||||
|
|
|
@ -450,11 +450,11 @@ DetectOpenAPIFile()
|
|||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
################################################################################
|
||||
#### Function DetectCloudFormationFile #########################################
|
||||
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html
|
||||
DetectCloudFormationFile()
|
||||
{
|
||||
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-formats.html
|
||||
# AWSTemplateFormatVersion is optional
|
||||
if grep 'AWSTemplateFormatVersion' "${1}" > /dev/null; then
|
||||
return 0
|
||||
|
@ -677,6 +677,7 @@ Footer()
|
|||
[ "$ERRORS_FOUND_POWERSHELL" -ne 0 ] || \
|
||||
[ "$ERRORS_FOUND_RUBY" -ne 0 ] || \
|
||||
[ "$ERRORS_FOUND_CSS" -ne 0 ] || \
|
||||
[ "$ERRORS_FOUND_CFN" -ne 0 ] || \
|
||||
[ "$ERRORS_FOUND_ENV" -ne 0 ] || \
|
||||
[ "$ERRORS_FOUND_OPENAPI" -ne 0 ] || \
|
||||
[ "$ERRORS_FOUND_PROTOBUF" -ne 0 ] || \
|
||||
|
|
Loading…
Reference in a new issue