feat!: validate configuration when using find (#5045)

- Fail if the configuration contains USE_FIND_ALGORITHM=true and
  VALIDATE_ALL_CODEBASE=false because this is an unsupported
  configuration. Before this change, super-linter silently ignored
  VALIDATE_ALL_CODEBASE, leading to potentially surprising behavior.
This commit is contained in:
Marco Ferrari 2023-12-25 11:15:42 +01:00 committed by GitHub
parent 20d12b4c7a
commit 69a45e022d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -40,7 +40,19 @@ This section helps you migrate from super-linter `v5` to `v6`.
information about how to ignore files with textlint, see
[the textlint documentation](https://textlint.github.io/docs/ignore.html).
### USE_FIND_ALGORITHM and VALIDATE_ALL_CODEBASE used together
- Setting `USE_FIND_ALGORITHM` to `true` and `VALIDATE_ALL_CODEBASE` to `false`
is an unsupported configuration. super-linter `v5` and earlier silently
ignored `VALIDATE_ALL_CODEBASE` when `USE_FIND_ALGORITHM` is set to `true`,
leading to potentially confusing behavior for users. super-linter `v6`
explicitly fail in this case. Remove one of the two from your configuration,
depending on the desired behavior.
### VALIDATE_KOTLIN_ANDROID
- The `VALIDATE_KOTLIN_ANDROID` variable has been deprecated. If you set it in
your configuration, change it to `VALIDATE_KOTLIN`.
- The `VALIDATE_KOTLIN_ANDROID` variable has been deprecated because ktlint
handles linting Kotlin files for Android using a configuration option, so
super-linter doesn't need to account for this special case anymore. If you
set `VALIDATE_KOTLIN_ANDROID` in your configuration, change it to
`VALIDATE_KOTLIN` and configure ktlint to lint Android files.

View file

@ -7,6 +7,10 @@ function GetValidationInfo() {
info "--------------------------------------------"
info "Gathering user validation information..."
if [[ "${USE_FIND_ALGORITHM}" == "true" ]] && [[ "${VALIDATE_ALL_CODEBASE}" == "false" ]]; then
fail "Setting USE_FIND_ALGORITHM to true and VALIDATE_ALL_CODEBASE to false is not supported because super-linter relies on Git to validate changed files."
fi
###########################################
# Skip validation if were running locally #
###########################################