diff --git a/README.md b/README.md index 7de71c83..c38e10ad 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,7 @@ But if you wish to select or exclude specific linters, we give you full control | **JAVASCRIPT_ES_CONFIG_FILE** | `.eslintrc.yml` | Filename for [eslint configuration](https://eslint.org/docs/user-guide/configuring#configuration-file-formats) (ex: `.eslintrc.yml`, `.eslintrc.json`) | | **JAVASCRIPT_DEFAULT_STYLE** | `standard` | Flag to set the default style of javascript. Available options: **standard**/**prettier** | | **JSCPD_CONFIG_FILE** | `.jscpd.json` | Filename for JSCPD configuration | +| **KUBERNETES_KUBEVAL_OPTIONS** | `null` | Additional arguments to pass to the command line when running **Kubernetes Kubeval** (Example: --ignore-missing-schemas) | | **LINTER_RULES_PATH** | `.github/linters` | Directory for all linter configuration rules. | | **LOG_FILE** | `super-linter.log` | The file name for outputting logs. All output is sent to the log file regardless of `LOG_LEVEL`. | | **LOG_LEVEL** | `VERBOSE` | How much output the script will generate to the console. One of `ERROR`, `WARN`, `NOTICE`, `VERBOSE`, `DEBUG` or `TRACE`. | diff --git a/lib/linter.sh b/lib/linter.sh index 02386def..675207ab 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -114,6 +114,8 @@ JSCPD_FILE_NAME="${JSCPD_CONFIG_FILE:-.jscpd.json}" # shellcheck disable=SC2034 # Variable is referenced indirectly JSX_FILE_NAME="${JAVASCRIPT_ES_CONFIG_FILE:-.eslintrc.yml}" # shellcheck disable=SC2034 # Variable is referenced indirectly +KUBERNETES_KUBEVAL_OPTIONS="${KUBERNETES_KUBEVAL_OPTIONS:-null}" +# shellcheck disable=SC2034 # Variable is referenced indirectly LATEX_FILE_NAME=".chktexrc" # shellcheck disable=SC2034 # Variable is referenced indirectly LUA_FILE_NAME=".luacheckrc" @@ -815,7 +817,11 @@ LINTER_COMMANDS_ARRAY['JSON']="jsonlint" LINTER_COMMANDS_ARRAY['JSONC']="eslint --no-eslintrc -c ${JAVASCRIPT_ES_LINTER_RULES} --ext .json5,.jsonc" LINTER_COMMANDS_ARRAY['JSX']="eslint --no-eslintrc -c ${JSX_LINTER_RULES}" LINTER_COMMANDS_ARRAY['KOTLIN']="ktlint" -LINTER_COMMANDS_ARRAY['KUBERNETES_KUBEVAL']="kubeval --strict" +if [ "${KUBERNETES_KUBEVAL_OPTIONS}" == "null" ] || [ -z "${KUBERNETES_KUBEVAL_OPTIONS}" ]; then + LINTER_COMMANDS_ARRAY['KUBERNETES_KUBEVAL']="kubeval --strict" +else + LINTER_COMMANDS_ARRAY['KUBERNETES_KUBEVAL']="kubeval --strict ${KUBERNETES_KUBEVAL_OPTIONS}" +fi LINTER_COMMANDS_ARRAY['LATEX']="chktex -q -l ${LATEX_LINTER_RULES}" LINTER_COMMANDS_ARRAY['LUA']="luacheck --config ${LUA_LINTER_RULES}" LINTER_COMMANDS_ARRAY['MARKDOWN']="markdownlint -c ${MARKDOWN_LINTER_RULES}"