From 4e1eb5f5e0bffb6484d6411426a4edd32e35eeed Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Fri, 7 Mar 2025 14:31:54 +0100 Subject: [PATCH] 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. --- lib/functions/output.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/functions/output.sh b/lib/functions/output.sh index 838331d1..bcc9a06b 100755 --- a/lib/functions/output.sh +++ b/lib/functions/output.sh @@ -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