add sql goods

This commit is contained in:
Lucas Gravley 2020-08-11 12:30:00 -05:00
parent b9bd73c892
commit 9856082087
5 changed files with 18 additions and 3 deletions

4
.github/linters/.sql-config.json vendored Normal file
View file

@ -0,0 +1,4 @@
{
"driver": "mysql",
"host": "localhost"
}

View file

@ -0,0 +1,4 @@
{
"driver": "mysql",
"host": "localhost"
}

View file

@ -1017,7 +1017,9 @@ moreThings()
### SQL Config file
- There is no top level _configuration file_ available at this time
- `.github/linters/.sql-config.json`
- You can pass multiple rules and overwrite default rules
- File should be located at: `.github/linters/.sql-json`
### SQL disable single line

View file

@ -110,6 +110,9 @@ PYTHON_FLAKE8_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${PYTHON_FLAKE8_FILE_NAME}
# Ruby Vars
RUBY_FILE_NAME="${RUBY_CONFIG_FILE:-.ruby-lint.yml}" # Name of the file
RUBY_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${RUBY_FILE_NAME}" # Path to the ruby lint rules
# SQL Vars
SQL_FILE_NAME=".sql-config.json" # Name of the file
SQL_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${SQL_FILE_NAME}" # Path to the SQL lint rules
# Terraform Vars
TERRAFORM_FILE_NAME='.tflint.hcl' # Name of the file
TERRAFORM_LINTER_RULES="${DEFAULT_RULES_LOCATION}/${TERRAFORM_FILE_NAME}" # Path to the Terraform lint rules
@ -1198,6 +1201,8 @@ GetLinterRules "PYTHON_PYLINT"
GetLinterRules "PYTHON_FLAKE8"
# Get Ruby rules
GetLinterRules "RUBY"
# Get SQL rules
GetLinterRules "SQL"
# Get Terraform rules
GetLinterRules "TERRAFORM"
# Get TypeScript rules
@ -1736,7 +1741,7 @@ if [ "${VALIDATE_SQL}" == "true" ]; then
# Lint the SQL files #
######################
# LintCodebase "FILE_TYPE" "LINTER_NAME" "LINTER_CMD" "FILE_TYPES_REGEX" "FILE_ARRAY"
LintCodebase "SQL" "sql-lint" "sql-lint" ".*\.\(sql\)\$" "${FILE_ARRAY_SQL[@]}"
LintCodebase "SQL" "sql-lint" "sql-lint -c ${SQL_LINTER_RULES}" ".*\.\(sql\)\$" "${FILE_ARRAY_SQL[@]}"
fi
#####################

View file

@ -603,7 +603,7 @@ function RunTestCases() {
TestCodebase "RAKU" "raku" "raku -c" ".*\.\(raku\|rakumod\|rakutest\|pm6\|pl6\|p6\)\$" "raku"
TestCodebase "RUBY" "rubocop" "rubocop -c ${RUBY_LINTER_RULES}" ".*\.\(rb\)\$" "ruby"
TestCodebase "STATES" "asl-validator" "asl-validator --json-path" ".*\.\(json\)\$" "states"
TestCodebase "SQL" "sql-lint" "sql-lint" ".*\.\(sql\)\$" "sql"
TestCodebase "SQL" "sql-lint" "sql-lint -c ${SQL_LINTER_RULES}" ".*\.\(sql\)\$" "sql"
TestCodebase "TERRAFORM" "tflint" "tflint -c ${TERRAFORM_LINTER_RULES}" ".*\.\(tf\)\$" "terraform"
TestCodebase "TERRAFORM_TERRASCAN" "terrascan" "terrascan -f" ".*\.\(tf\)\$" "terraform_terrascan"
TestCodebase "TYPESCRIPT_ES" "eslint" "eslint --no-eslintrc -c ${TYPESCRIPT_LINTER_RULES}" ".*\.\(ts\)\$" "typescript"