fix: emit prettier verbose output when debugging (#6636)

Set Prettier output to warn unless Super-linter debug output is enabled
to avoid that Prettier prints its default output when formatting the
summary file, potentially confusing users.
This commit is contained in:
Marco Ferrari 2025-03-07 14:31:54 +01:00 committed by GitHub
parent 417a58a62d
commit 4e1eb5f5e0
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: B5690EEEBB952194

View file

@ -42,6 +42,12 @@ WriteSummaryFooterFailure() {
FormatSuperLinterSummaryFile() {
local SUPER_LINTER_SUMMARY_OUTPUT_PATH="${1}"
local SUPER_LINTER_SUMMARY_FORMAT_COMMAND=(prettier --write)
# Avoid emitting output except of warnings and errors if debug logging is
# disabled.
if [[ "${LOG_DEBUG}" != "true" ]]; then
SUPER_LINTER_SUMMARY_FORMAT_COMMAND+=(--log-level warn)
fi
# Override the default prettier ignore paths (.gitignore, .prettierignore) to
# avoid considering their defaults because prettier will skip formatting
# the summary report file if the summary report file is ignored in those