mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 06:53:52 +01:00
Merge pull request #15795 from miri64/dist/fix/diff-output
static_tests: fix diff output
This commit is contained in:
commit
8dec3f2833
10
dist/tools/coccinelle/check.sh
vendored
10
dist/tools/coccinelle/check.sh
vendored
@ -31,9 +31,9 @@ _annotate_diff() {
|
||||
if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
|
||||
MSG="Coccinelle proposes the following patch:\n\n$3"
|
||||
if [ $COCCINELLE_WARNONLY -eq 0 ]; then
|
||||
github_annotate_error "$1" "$2" "${MSG}"
|
||||
IFS="${OLD_IFS}" github_annotate_error "$1" "$2" "${MSG}"
|
||||
else
|
||||
github_annotate_warning "$1" "$2" "${MSG}"
|
||||
IFS="${OLD_IFS}" github_annotate_warning "$1" "$2" "${MSG}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -59,7 +59,9 @@ coccinelle_checkone() {
|
||||
echo "$OUT" | {
|
||||
# see https://stackoverflow.com/a/30064493/11921757 for why we
|
||||
# use a sub shell here
|
||||
while read line; do
|
||||
OLD_IFS="${IFS}" # store old separator to later restore it
|
||||
IFS='' # keep leading and trailing spaces
|
||||
while read -r line; do
|
||||
# parse beginning of new diff
|
||||
if echo "$line" | grep -q '^--- .\+$'; then
|
||||
_annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF"
|
||||
@ -84,7 +86,7 @@ coccinelle_checkone() {
|
||||
fi
|
||||
DIFFLINE="$(echo "$line" | sed 's/@@ -\([0-9]\+\).*$/\1/')"
|
||||
fi
|
||||
DIFF="$DIFF\n$line"
|
||||
DIFF="$DIFF\n${line//\\/\\\\}"
|
||||
fi
|
||||
done
|
||||
_annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF"
|
||||
|
||||
8
dist/tools/headerguards/check.sh
vendored
8
dist/tools/headerguards/check.sh
vendored
@ -25,7 +25,7 @@ filter() {
|
||||
|
||||
_annotate_diff() {
|
||||
if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
|
||||
github_annotate_error "$1" "$2" "Wrong header guard format:\n\n$3"
|
||||
IFS="${OLD_IFS}" github_annotate_error "$1" "$2" "Wrong header guard format:\n\n$3"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -40,7 +40,9 @@ _headercheck() {
|
||||
echo "$OUT" | {
|
||||
# see https://stackoverflow.com/a/30064493/11921757 for why we
|
||||
# use a sub shell here
|
||||
while read line; do
|
||||
OLD_IFS="$IFS" # store old separator to later restore it
|
||||
IFS='' # keep leading and trailing spaces
|
||||
while read -r line; do
|
||||
# file has no or broken header guard
|
||||
if echo "$line" | grep -q '^.*: no / broken header guard$'; then
|
||||
# this output comes outside of a diff, so reset diff parser
|
||||
@ -71,7 +73,7 @@ _headercheck() {
|
||||
fi
|
||||
DIFFLINE="$(echo "$line" | sed 's/@@ -\([0-9]\+\).*$/\1/')"
|
||||
fi
|
||||
DIFF="$DIFF\n$line"
|
||||
DIFF="$DIFF\n$(echo "${line}"| sed 's/\\/\\\\/g' )"
|
||||
fi
|
||||
done
|
||||
_annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF"
|
||||
|
||||
8
dist/tools/uncrustify/uncrustify.sh
vendored
8
dist/tools/uncrustify/uncrustify.sh
vendored
@ -32,7 +32,7 @@ check () {
|
||||
_annotate_diff() {
|
||||
if [ -n "$1" -a -n "$2" -a -n "$3" ]; then
|
||||
MSG="Uncrustify proposes the following patch:\n\n$3"
|
||||
github_annotate_error "$1" "$2" "${MSG}"
|
||||
IFS="${OLD_IFS}" github_annotate_error "$1" "$2" "${MSG}"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -52,7 +52,9 @@ exec_uncrustify () {
|
||||
git diff HEAD | {
|
||||
# see https://stackoverflow.com/a/30064493/11921757 for why we
|
||||
# use a sub shell here
|
||||
while read line; do
|
||||
OLD_IFS="$IFS" # store old separator to later restore it
|
||||
IFS='' # keep leading and trailing spaces
|
||||
while read -r line; do
|
||||
# parse beginning of new diff
|
||||
if echo "$line" | grep -q '^--- .\+$'; then
|
||||
_annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF"
|
||||
@ -74,7 +76,7 @@ exec_uncrustify () {
|
||||
fi
|
||||
DIFFLINE="$(echo "$line" | sed 's/@@ -\([0-9]\+\).*$/\1/')"
|
||||
fi
|
||||
DIFF="$DIFF\n$line"
|
||||
DIFF="$DIFF\n${line//\\/\\\\}"
|
||||
fi
|
||||
done
|
||||
_annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user