Skip to content

Commit

Permalink
docs: Add comment about no dry run for <9
Browse files Browse the repository at this point in the history
  • Loading branch information
jidicula committed Jul 25, 2022
1 parent 1eb2700 commit 5d76933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d76933

Please sign in to comment.