Loading scripts/check-format.sh +154 −155 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ if [ ! -d "lib_com" ]; then fi CLANG_FORMAT=clang-format CLANG_FORMAT_REQUIRED_VERSION="13.0" CLANG_FORMAT_REQUIRED_VERSION="18.1" # list (with space between entries) of substrings that are excluded from the file list, e.g. very large files EXCLUDE_FILES="ivas_rom_binaural_crend_head.c" Loading Loading @@ -69,8 +69,7 @@ cl-format-apply() { ${CLANG_FORMAT} -i $1 } ensure-one-newline() { ensure-one-newline() { # first command adds a newline at the end of the file if there might be none # -> clang-format-13 does not add them and warnings e.g. on MacOS are triggered by them sed -i -e '$a\' $1 Loading Loading @@ -109,7 +108,7 @@ cl-format-check() { DIFF=$(diff -u $I <(echo "$O")) if [ $COLOR ]; then if [[ "$OSTYPE" == "darwin"* ]]; then echo "$DIFF" | sed "s/^-/`echo -e \"\x1b\"`[41m-/;s/^+/`echo -e \"\x1b\"`[42m+/;s/^@/`echo -e \"\x1b\"`[34m@/;s/$/`echo -e \"\x1b\"`[0m/" echo "$DIFF" | sed "s/^-/$(echo -e \"\x1b\")[41m-/;s/^+/$(echo -e \"\x1b\")[42m+/;s/^@/$(echo -e \"\x1b\")[34m@/;s/$/$(echo -e \"\x1b\")[0m/" else echo "$DIFF" | sed 's/^-/\x1b[41m-/;s/^+/\x1b[42m+/;s/^@/\x1b[34m@/;s/$/\x1b[0m/' fi Loading Loading @@ -223,21 +222,21 @@ else ( cl-format-check $i $COLOR RET=$? if [[ $RET -gt 0 ]] then if [[ $RET -gt 0 ]]; then echo "1" >>"$NUMFAILSTMPFILE" fi ((NUMFAILS += RET)) if [ $FORMAT ]; then ensure-one-newline $i cl-format-apply $i fi ) & fi ) & while [[ $(jobs -r -p | wc -l) -ge $NUMPROCS ]]; do sleep 0.1 done done wait NUMFAILS=`cat $NUMFAILSTMPFILE | wc -l` NUMFAILS=$(cat $NUMFAILSTMPFILE | wc -l) rm "$NUMFAILSTMPFILE" if [[ $NUMFAILS -gt 0 ]]; then echo "Total fails: $NUMFAILS" Loading Loading
scripts/check-format.sh +154 −155 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ if [ ! -d "lib_com" ]; then fi CLANG_FORMAT=clang-format CLANG_FORMAT_REQUIRED_VERSION="13.0" CLANG_FORMAT_REQUIRED_VERSION="18.1" # list (with space between entries) of substrings that are excluded from the file list, e.g. very large files EXCLUDE_FILES="ivas_rom_binaural_crend_head.c" Loading Loading @@ -69,8 +69,7 @@ cl-format-apply() { ${CLANG_FORMAT} -i $1 } ensure-one-newline() { ensure-one-newline() { # first command adds a newline at the end of the file if there might be none # -> clang-format-13 does not add them and warnings e.g. on MacOS are triggered by them sed -i -e '$a\' $1 Loading Loading @@ -109,7 +108,7 @@ cl-format-check() { DIFF=$(diff -u $I <(echo "$O")) if [ $COLOR ]; then if [[ "$OSTYPE" == "darwin"* ]]; then echo "$DIFF" | sed "s/^-/`echo -e \"\x1b\"`[41m-/;s/^+/`echo -e \"\x1b\"`[42m+/;s/^@/`echo -e \"\x1b\"`[34m@/;s/$/`echo -e \"\x1b\"`[0m/" echo "$DIFF" | sed "s/^-/$(echo -e \"\x1b\")[41m-/;s/^+/$(echo -e \"\x1b\")[42m+/;s/^@/$(echo -e \"\x1b\")[34m@/;s/$/$(echo -e \"\x1b\")[0m/" else echo "$DIFF" | sed 's/^-/\x1b[41m-/;s/^+/\x1b[42m+/;s/^@/\x1b[34m@/;s/$/\x1b[0m/' fi Loading Loading @@ -223,21 +222,21 @@ else ( cl-format-check $i $COLOR RET=$? if [[ $RET -gt 0 ]] then if [[ $RET -gt 0 ]]; then echo "1" >>"$NUMFAILSTMPFILE" fi ((NUMFAILS += RET)) if [ $FORMAT ]; then ensure-one-newline $i cl-format-apply $i fi ) & fi ) & while [[ $(jobs -r -p | wc -l) -ge $NUMPROCS ]]; do sleep 0.1 done done wait NUMFAILS=`cat $NUMFAILSTMPFILE | wc -l` NUMFAILS=$(cat $NUMFAILSTMPFILE | wc -l) rm "$NUMFAILSTMPFILE" if [[ $NUMFAILS -gt 0 ]]; then echo "Total fails: $NUMFAILS" Loading