Merge pull request #474 from GaboFDC/gf_fix_yaml

Fix YAML
This commit is contained in:
Lukas Gravley 2020-07-27 08:54:44 -05:00 committed by GitHub
commit ce9235449c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View file

@ -218,6 +218,8 @@ and won't run anything unexpected.
| **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) | | **VALIDATE_TYPESCRIPT_STANDARD** | `true` | Flag to enable or disable the linting process of the Typescript language. (Utilizing: standard) |
| **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the XML language. | | **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the XML language. |
| **VALIDATE_YAML** | `true` | Flag to enable or disable the linting process of the YAML language. | | **VALIDATE_YAML** | `true` | Flag to enable or disable the linting process of the YAML language. |
| **YAML_CONFIG_FILE** | `.yaml-lint.yml` | Filename for [Yamllint configuration](https://yamllint.readthedocs.io/en/stable/configuration.html) (ex: `.yaml-lint.yml`, `.yamllint.yml`) |
### Template rules files ### Template rules files

View file

@ -106,7 +106,7 @@ function BuildFileList() {
################################ ################################
# Append the file to the array # # Append the file to the array #
################################ ################################
FILE_ARRAY_YML+=("${FILE}") FILE_ARRAY_YAML+=("${FILE}")
########################################################## ##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec # # Set the READ_ONLY_CHANGE_FLAG since this could be exec #
########################################################## ##########################################################

View file

@ -88,7 +88,7 @@ TYPESCRIPT_FILE_NAME="${TYPESCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}"
TYPESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TYPESCRIPT_FILE_NAME}" # Path to the Typescript lint rules TYPESCRIPT_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TYPESCRIPT_FILE_NAME}" # Path to the Typescript lint rules
TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard TYPESCRIPT_STANDARD_LINTER_RULES='' # ENV string to pass when running js standard
# YAML Vars # YAML Vars
YAML_FILE_NAME='.yaml-lint.yml' # Name of the file YAML_FILE_NAME="${YAML_CONFIG_FILE:-.yaml-lint.yml}" # Name of the file
YAML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${YAML_FILE_NAME}" # Path to the yaml lint rules YAML_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${YAML_FILE_NAME}" # Path to the yaml lint rules
####################################### #######################################
@ -109,7 +109,7 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT'
'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'MARKDOWN' 'OPENAPI' 'JAVASCRIPT_STANDARD' 'JSON' 'JSX' 'KOTLIN' 'MARKDOWN' 'OPENAPI'
'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON' 'PERL' 'PHP' 'POWERSHELL' 'PROTOBUF' 'PYTHON'
'RAKU' 'RUBY' 'STATES' 'TERRAFORM' 'TERRAFORM_TERRASCAN' 'TSX' 'TYPESCRIPT_ES' 'RAKU' 'RUBY' 'STATES' 'TERRAFORM' 'TERRAFORM_TERRASCAN' 'TSX' 'TYPESCRIPT_ES'
'TYPESCRIPT_STANDARD' 'XML' 'YML') 'TYPESCRIPT_STANDARD' 'XML' 'YAML')
############################################ ############################################
# Array for all languages that were linted # # Array for all languages that were linted #
@ -242,7 +242,7 @@ FILE_ARRAY_TSX=() # Array of files to check
FILE_ARRAY_TYPESCRIPT_ES=() # 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_TYPESCRIPT_STANDARD=() # Array of files to check
FILE_ARRAY_XML=() # Array of files to check FILE_ARRAY_XML=() # Array of files to check
FILE_ARRAY_YML=() # Array of files to check FILE_ARRAY_YAML=() # Array of files to check
############ ############
# Counters # # Counters #
@ -315,8 +315,8 @@ ERRORS_FOUND_TYPESCRIPT_ES=0 # Count of errors found
export ERRORS_FOUND_TYPESCRIPT_ES # Workaround SC2034 export ERRORS_FOUND_TYPESCRIPT_ES # Workaround SC2034
ERRORS_FOUND_XML=0 # Count of errors found ERRORS_FOUND_XML=0 # Count of errors found
export ERRORS_FOUND_XML # Workaround SC2034 export ERRORS_FOUND_XML # Workaround SC2034
ERRORS_FOUND_YML=0 # Count of errors found ERRORS_FOUND_YAML=0 # Count of errors found
export ERRORS_FOUND_YML # Workaround SC2034 export ERRORS_FOUND_YAML # Workaround SC2034
################################################################################ ################################################################################
########################## FUNCTIONS BELOW ##################################### ########################## FUNCTIONS BELOW #####################################
@ -1092,7 +1092,7 @@ GetLinterRules "RUBY"
GetLinterRules "TERRAFORM" GetLinterRules "TERRAFORM"
# Get TypeScript rules # Get TypeScript rules
GetLinterRules "TYPESCRIPT" GetLinterRules "TYPESCRIPT"
# Get YML rules # Get YAML rules
GetLinterRules "YAML" GetLinterRules "YAML"
################################# #################################
@ -1623,14 +1623,14 @@ if [ "${VALIDATE_XML}" == "true" ]; then
fi fi
############### ###############
# YML LINTING # # YAML LINTING #
############### ###############
if [ "${VALIDATE_YAML}" == "true" ]; then if [ "${VALIDATE_YAML}" == "true" ]; then
###################### ######################
# Lint the Yml Files # # Lint the Yml Files #
###################### ######################
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY" # LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
LintCodebase "YML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "${FILE_ARRAY_YML[@]}" LintCodebase "YAML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "${FILE_ARRAY_YAML[@]}"
fi fi
########### ###########

View file

@ -610,7 +610,7 @@ function RunTestCases() {
TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "typescript"
TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin ${TYPESCRIPT_STANDARD_LINTER_RULES}" ".*\.\(ts\)\$" "typescript" TestCodebase "TYPESCRIPT_STANDARD" "standard" "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin ${TYPESCRIPT_STANDARD_LINTER_RULES}" ".*\.\(ts\)\$" "typescript"
TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml" TestCodebase "XML" "xmllint" "xmllint" ".*\.\(xml\)\$" "xml"
TestCodebase "YML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "yml" TestCodebase "YAML" "yamllint" "yamllint -c ${YAML_LINTER_RULES}" ".*\.\(yml\|yaml\)\$" "yml"
################# #################
# Footer prints # # Footer prints #