From 629d3cd39d26386f00f97afa993a4edb262bcfce Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 14 Jan 2021 12:12:50 +0100 Subject: [PATCH] uncrustify: use unified diff to generate GH annotation `git diff` creates diffs where the file name starts with `a/` or `b/` respectively. These are obviously not in path, so the Github annotations point to nowhere when the path is used without accounting for this. This fixes the GH annotation parsing to account for that. --- dist/tools/uncrustify/uncrustify.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/tools/uncrustify/uncrustify.sh b/dist/tools/uncrustify/uncrustify.sh index bfe1661160..93cc35165f 100755 --- a/dist/tools/uncrustify/uncrustify.sh +++ b/dist/tools/uncrustify/uncrustify.sh @@ -57,7 +57,8 @@ exec_uncrustify () { if echo "$line" | grep -q '^--- .\+$'; then _annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF" DIFF="$line" - DIFFFILE=$(echo "$line" | sed 's/^--- \(.\+\)$/\1/g') + DIFFFILE=$(echo "$line" | + sed 's#^--- \([ab]/\)\?\(.\+\)$#\2#g') DIFFLINE="" # we are in a diff currently elif [ -n "$DIFF" ]; then