diff --git a/check.sh b/check.sh index f7c02ac..43307fc 100755 --- a/check.sh +++ b/check.sh @@ -22,7 +22,7 @@ format_diff() { # Invoke clang-format with dry run and formatting error output if [[ $CLANG_FORMAT_VERSION -gt "9" ]]; then local_format="$(docker run -i -v "$(pwd)":"$(pwd)" -w "$(pwd)" ghcr.io/jidicula/clang-format:"$CLANG_FORMAT_VERSION" -n --Werror --style=file --fallback-style="$FALLBACK_STYLE" "${filepath}")" - else + else # Versions below 9 don't have dry run formatted="$(docker run -i -v "$(pwd)":"$(pwd)" -w "$(pwd)" ghcr.io/jidicula/clang-format:"$CLANG_FORMAT_VERSION" --style=file --fallback-style="$FALLBACK_STYLE" "${filepath}")" local_format="$(diff -q <(cat "${filepath}") <(echo "${formatted}"))" fi