Add renovate-config-validator (#4643)

This commit is contained in:
Masaya Suzuki 2023-09-13 01:58:09 +09:00 committed by GitHub
parent 384e8ff567
commit 3703f392e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 6838 additions and 7 deletions

View file

@ -0,0 +1,18 @@
{
"ignooooooooorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"iggggggggnoreDeps": [
"go",
"node-fetch"
],
"constraaaaaaaaaints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,18 @@
{
"ignooooooooorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"iggggggggnoreDeps": [
"go",
"node-fetch"
],
"constraaaaaaaaaints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,18 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"ignoreDeps": [
"go",
"node-fetch"
],
"constraints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,18 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"ignoreDeps": [
"go",
"node-fetch"
],
"constraints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,20 @@
# Renovate Test Cases
This folder holds the test cases for **renovate**.
## Additional Docs
No Additional information is needed for this test case.
## Good Test Cases
The test cases denoted: `LANGUAGE_good_FILE.EXTENSION` are all valid, and should pass successfully when linted.
- **Note:** They are linted utilizing the default linter rules.
## Bad Test Cases
The test cases denoted: `LANGUAGE_bad_FILE.EXTENSION` are **NOT** valid, and should trigger errors when linted.
- **Note:** They are linted utilizing the default linter rules.
{"mode":"full","isActive":false}

View file

@ -0,0 +1,18 @@
{
"ignooooooooorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"iggggggggnoreDeps": [
"go",
"node-fetch"
],
"constraaaaaaaaaints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,18 @@
{
"ignooooooooorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"iggggggggnoreDeps": [
"go",
"node-fetch"
],
"constraaaaaaaaaints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,18 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"ignoreDeps": [
"go",
"node-fetch"
],
"constraints": {
"go": "1.20"
}
}

View file

@ -0,0 +1,18 @@
{
"ignorePaths": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/examples/**",
"**/__tests__/**",
"**/tests/**",
"**/__fixtures__/**"
],
"ignoreDeps": [
"go",
"node-fetch"
],
"constraints": {
"go": "1.20"
}
}

View file

@ -90,6 +90,7 @@ Developers on **GitHub** can call the **GitHub Action** to lint their codebase w
| **Python3** | [pylint](https://pylint.pycqa.org/) / [flake8](https://flake8.pycqa.org/en/latest/) / [black](https://github.com/psf/black) / [isort](https://pypi.org/project/isort/) | | **Python3** | [pylint](https://pylint.pycqa.org/) / [flake8](https://flake8.pycqa.org/en/latest/) / [black](https://github.com/psf/black) / [isort](https://pypi.org/project/isort/) |
| **R** | [lintr](https://github.com/jimhester/lintr) | | **R** | [lintr](https://github.com/jimhester/lintr) |
| **Raku** | [Raku](https://raku.org) | | **Raku** | [Raku](https://raku.org) |
| **Renovate** | [renovate-config-validator](https://docs.renovatebot.com/config-validation/) |
| **Ruby** | [RuboCop](https://github.com/rubocop-hq/rubocop) | | **Ruby** | [RuboCop](https://github.com/rubocop-hq/rubocop) |
| **Rust** | [Rustfmt](https://github.com/rust-lang/rustfmt) / [Clippy](https://github.com/rust-lang/rust-clippy) | | **Rust** | [Rustfmt](https://github.com/rust-lang/rustfmt) / [Clippy](https://github.com/rust-lang/rust-clippy) |
| **Scala** | [scalafmt](https://github.com/scalameta/scalafmt) | | **Scala** | [scalafmt](https://github.com/scalameta/scalafmt) |
@ -389,6 +390,7 @@ But if you wish to select or exclude specific linters, we give you full control
| **VALIDATE_PYTHON_PYLINT** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: pylint) | | **VALIDATE_PYTHON_PYLINT** | `true` | Flag to enable or disable the linting process of the Python language. (Utilizing: pylint) |
| **VALIDATE_R** | `true` | Flag to enable or disable the linting process of the R language. | | **VALIDATE_R** | `true` | Flag to enable or disable the linting process of the R language. |
| **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. | | **VALIDATE_RAKU** | `true` | Flag to enable or disable the linting process of the Raku language. |
| **VALIDATE_RENOVATE** | `true` | Flag to enable or disable the linting process of the Renovate configuration files. |
| **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. | | **VALIDATE_RUBY** | `true` | Flag to enable or disable the linting process of the Ruby language. |
| **VALIDATE_RUST_2015** | `true` | Flag to enable or disable the linting process of the Rust language. (edition: 2015) | | **VALIDATE_RUST_2015** | `true` | Flag to enable or disable the linting process of the Rust language. (edition: 2015) |
| **VALIDATE_RUST_2018** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2018) | | **VALIDATE_RUST_2018** | `true` | Flag to enable or disable the linting process of Rust language. (edition: 2018) |

6658
dependencies/package-lock.json generated vendored

File diff suppressed because it is too large Load diff

View file

@ -42,6 +42,7 @@
"react-intl": "^6.4.4", "react-intl": "^6.4.4",
"react-redux": "^8.1.2", "react-redux": "^8.1.2",
"react-router-dom": "^6.15.0", "react-router-dom": "^6.15.0",
"renovate": "^36.92.0",
"sql-lint": "1.0.0", "sql-lint": "1.0.0",
"standard": "^17.1.0", "standard": "^17.1.0",
"stylelint": "^15.10.3", "stylelint": "^15.10.3",

View file

@ -336,6 +336,12 @@ function BuildFileList() {
FILE_ARRAY_GITLEAKS+=("${FILE}") FILE_ARRAY_GITLEAKS+=("${FILE}")
fi fi
# See https://docs.renovatebot.com/configuration-options/
if [[ "${BASE_FILE}" =~ renovate.+json5? ]] ||
[ "${BASE_FILE}" == ".renovaterc" ] || [[ "${BASE_FILE}" =~ .renovaterc.+json5? ]]; then
FILE_ARRAY_RENOVATE+=("${FILE}")
fi
####################### #######################
# Get the shell files # # Get the shell files #
####################### #######################

View file

@ -93,6 +93,8 @@ BuildLinterVersions() {
elif [[ ${LINTER} == "lua" ]]; then elif [[ ${LINTER} == "lua" ]]; then
# Semi standardversion command # Semi standardversion command
GET_VERSION_CMD="$("${LINTER}" -v 2>&1)" GET_VERSION_CMD="$("${LINTER}" -v 2>&1)"
elif [[ ${LINTER} == "renovate-config-validator" ]]; then
GET_VERSION_CMD="$(renovate --version 2>&1)"
elif [[ ${LINTER} == "terrascan" ]]; then elif [[ ${LINTER} == "terrascan" ]]; then
GET_VERSION_CMD="$("${LINTER}" version 2>&1)" GET_VERSION_CMD="$("${LINTER}" version 2>&1)"
else else

View file

@ -253,6 +253,14 @@ function LintCodebase() {
cd "${DIR_NAME}" || exit cd "${DIR_NAME}" || exit
${LINTER_COMMAND} "${FILE_NAME}" 2>&1 ${LINTER_COMMAND} "${FILE_NAME}" 2>&1
) )
######################
# Check for Renovate #
######################
elif [[ ${FILE_TYPE} == "RENOVATE" ]]; then
LINT_CMD=$(
cd "${WORKSPACE_PATH}" || exit
RENOVATE_CONFIG_FILE="${FILE}" ${LINTER_COMMAND} 2>&1
)
############################################################################################ ############################################################################################
# Corner case for TERRAFORM_TFLINT as it cant use the full path and needs to fetch modules # # Corner case for TERRAFORM_TFLINT as it cant use the full path and needs to fetch modules #
############################################################################################ ############################################################################################

View file

@ -267,7 +267,7 @@ LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC' 'CLANG_FORMAT'
'KUBERNETES_KUBECONFORM' 'KOTLIN' 'KOTLIN_ANDROID' 'LATEX' 'LUA' 'MARKDOWN' 'KUBERNETES_KUBECONFORM' 'KOTLIN' 'KOTLIN_ANDROID' 'LATEX' 'LUA' 'MARKDOWN'
'NATURAL_LANGUAGE' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN' 'NATURAL_LANGUAGE' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN'
'PHP_PSALM' 'POWERSHELL' 'PROTOBUF' 'PYTHON_BLACK' 'PYTHON_PYLINT' 'PHP_PSALM' 'POWERSHELL' 'PROTOBUF' 'PYTHON_BLACK' 'PYTHON_PYLINT'
'PYTHON_FLAKE8' 'PYTHON_ISORT' 'PYTHON_MYPY' 'R' 'RAKU' 'RUBY' 'RUST_2015' 'PYTHON_FLAKE8' 'PYTHON_ISORT' 'PYTHON_MYPY' 'R' 'RAKU' 'RENOVATE' 'RUBY' 'RUST_2015'
'RUST_2018' 'RUST_2021' 'RUST_CLIPPY' 'SCALAFMT' 'SHELL_SHFMT' 'RUST_2018' 'RUST_2021' 'RUST_CLIPPY' 'SCALAFMT' 'SHELL_SHFMT'
'SNAKEMAKE_LINT' 'SNAKEMAKE_SNAKEFMT' 'STATES' 'SQL' 'SQLFLUFF' 'TEKTON' 'SNAKEMAKE_LINT' 'SNAKEMAKE_SNAKEFMT' 'STATES' 'SQL' 'SQLFLUFF' 'TEKTON'
'TERRAFORM_FMT' 'TERRAFORM_TFLINT' 'TERRAFORM_TERRASCAN' 'TERRAGRUNT' 'TSX' 'TERRAFORM_FMT' 'TERRAFORM_TFLINT' 'TERRAFORM_TERRASCAN' 'TERRAGRUNT' 'TSX'
@ -328,6 +328,7 @@ LINTER_NAMES_ARRAY['PYTHON_ISORT']="isort"
LINTER_NAMES_ARRAY['PYTHON_MYPY']="mypy" LINTER_NAMES_ARRAY['PYTHON_MYPY']="mypy"
LINTER_NAMES_ARRAY['R']="R" LINTER_NAMES_ARRAY['R']="R"
LINTER_NAMES_ARRAY['RAKU']="raku" LINTER_NAMES_ARRAY['RAKU']="raku"
LINTER_NAMES_ARRAY['RENOVATE']="renovate-config-validator"
LINTER_NAMES_ARRAY['RUBY']="rubocop" LINTER_NAMES_ARRAY['RUBY']="rubocop"
LINTER_NAMES_ARRAY['RUST_2015']="rustfmt" LINTER_NAMES_ARRAY['RUST_2015']="rustfmt"
LINTER_NAMES_ARRAY['RUST_2018']="rustfmt" LINTER_NAMES_ARRAY['RUST_2018']="rustfmt"
@ -975,6 +976,7 @@ LINTER_COMMANDS_ARRAY['PYTHON_ISORT']="isort --check --diff --sp ${PYTHON_ISORT_
LINTER_COMMANDS_ARRAY['PYTHON_MYPY']="mypy --config-file ${PYTHON_MYPY_LINTER_RULES} --install-types --non-interactive" LINTER_COMMANDS_ARRAY['PYTHON_MYPY']="mypy --config-file ${PYTHON_MYPY_LINTER_RULES} --install-types --non-interactive"
LINTER_COMMANDS_ARRAY['R']="lintr" LINTER_COMMANDS_ARRAY['R']="lintr"
LINTER_COMMANDS_ARRAY['RAKU']="raku" LINTER_COMMANDS_ARRAY['RAKU']="raku"
LINTER_COMMANDS_ARRAY['RENOVATE']="renovate-config-validator --strict"
LINTER_COMMANDS_ARRAY['RUBY']="rubocop -c ${RUBY_LINTER_RULES} --force-exclusion --ignore-unrecognized-cops" LINTER_COMMANDS_ARRAY['RUBY']="rubocop -c ${RUBY_LINTER_RULES} --force-exclusion --ignore-unrecognized-cops"
LINTER_COMMANDS_ARRAY['RUST_2015']="rustfmt --check --edition 2015" LINTER_COMMANDS_ARRAY['RUST_2015']="rustfmt --check --edition 2015"
LINTER_COMMANDS_ARRAY['RUST_2018']="rustfmt --check --edition 2018" LINTER_COMMANDS_ARRAY['RUST_2018']="rustfmt --check --edition 2018"