Skip to content

Commit

Permalink
checkpatch: only print output for issues
Browse files Browse the repository at this point in the history
No need to print code blocks if there are no issues, save space for
important info.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Feb 23, 2024
1 parent ebef5cc commit b72e1d4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,15 @@ _checkpatch() {
-g HEAD 2>&1 | tee "${TMPFILE}" >&2

{
echo "- Commit $(get_commit_md):"
echo "\`\`\`"
cat "${TMPFILE}"
echo "\`\`\`"
echo -n "- Commit $(get_commit_md):"
if ! grep -q "^total: 0 errors, 0 warnings, 0 checks" "${TMPFILE}"; then
echo
echo "\`\`\`"
cat "${TMPFILE}"
echo "\`\`\`"
else
echo " no checkpatch issue"
fi
} >> "${CHECKPATCH_DETAILS}"

grep "^total:" "${TMPFILE}" | tail -n1
Expand Down

0 comments on commit b72e1d4

Please sign in to comment.