Skip to content

Commit 90abb71

Browse files
L-seriesmkannwischer
authored andcommitted
CI: lint: output errors
This commit accumulates the names of the checks which have failed while linting and exposes them to the outer context window in order to guide the user. Signed-off-by: Andreas Hatziiliou <andreas.hatziiliou@savoirfairelinux.com>
1 parent db65535 commit 90abb71

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/lint

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ GREEN="\033[32m"
2222
RED="\033[31m"
2323
NORMAL="\033[0m"
2424

25+
# Global error info
26+
ERROR_LOG=""
27+
2528
info()
2629
{
2730
printf "%b %b\n" "${GREEN}" "${NORMAL}${*}"
@@ -86,6 +89,7 @@ gh_summary_failure()
8689
{
8790
if $IN_GITHUB_CONTEXT; then
8891
echo ":x: $1" >>"$GITHUB_STEP_SUMMARY"
92+
ERROR_LOG+=" - $1"$'\n'
8993
fi
9094
}
9195

@@ -223,6 +227,7 @@ check-spdx()
223227
error "Check SPDX + Copyright"
224228
SUCCESS=false
225229
gh_summary_failure "Check SPDX + Copyright"
230+
226231
fi
227232
}
228233
gh_group_start "Checking SPDX + Copyright headers"
@@ -261,10 +266,6 @@ gh_group_start "Check magic constants"
261266
check-magic
262267
gh_group_end
263268

264-
if ! $SUCCESS; then
265-
exit 1
266-
fi
267-
268269
check-contracts()
269270
{
270271
if python3 "$ROOT"/scripts/check-contracts >/dev/null; then
@@ -282,5 +283,9 @@ check-contracts
282283
gh_group_end
283284

284285
if ! $SUCCESS; then
286+
if $IN_GITHUB_CONTEXT; then
287+
printf "%b%s%b\n" "${RED}" "The following checks failed, expand each for more details." "${NORMAL}"
288+
echo "$ERROR_LOG"
289+
fi
285290
exit 1
286291
fi

0 commit comments

Comments
 (0)