Skip to content

Commit

Permalink
Merge pull request #103 from rwalker-apple/clang-format-nits
Browse files Browse the repository at this point in the history
clang-format integration nits
  • Loading branch information
woody-apple authored Mar 24, 2020
2 parents e56dd0e + 5db3314 commit 8eeba26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 1 addition & 5 deletions integrations/clang/clang-format-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# replacements.
#

# shellcheck disable=SC2120
die() {
echo " *** ERROR: $*"
exit 1
Expand All @@ -19,9 +18,6 @@ die() {

for arg; do true; done
file=$arg
[[ -n "$(tail -c1 "$file")" ]] && {
echo " *** ERROR: Missing EOF newline: $file"
exit 1
}
[[ -z $(tail -c1 "$file") ]] || die "Missing EOF newline: $file"

exit 0
7 changes: 3 additions & 4 deletions integrations/clang/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

CLANG_FORMAT_VERSION="clang-format version 9.0"

# shellcheck disable=SC2120
die() {
echo " *** ERROR: $*"
exit 1
Expand All @@ -15,11 +14,11 @@ elif command -v clang-format > /dev/null; then
"$CLANG_FORMAT_VERSION"*)
;;
*)
die "$(clang-format --version); clang-format 9.0 required"
die "$(clang-format --version); \"$CLANG_FORMAT_VERSION\" required"
;;
esac
else
die "clang-format 9.0 required"
die "$CLANG_FORMAT_VERSION required"
fi

clang-format "$@" || die "format failed"
Expand All @@ -38,7 +37,7 @@ done
file=$arg

[[ $REPLACE != yes ]] || {
[[ -n "$(tail -c1 "$file")" ]] && echo >> "$file"
[[ -z $(tail -c1 "$file") ]] || echo >> "$file"
}

exit 0

0 comments on commit 8eeba26

Please sign in to comment.