aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh')
-rwxr-xr-xtools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
index 60fd30cd6f..ededc6e809 100755
--- a/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
+++ b/tools/dockerfile/grpc_clang_format/clang_format_all_the_things.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2015, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+set -e
+
# directories to run against
DIRS="src/core src/cpp test/core test/cpp include"
@@ -50,9 +52,17 @@ if [ "x$TEST" = "x" ]
then
echo $files | xargs $CLANG_FORMAT -i
else
+ ok=yes
for file in $files
do
- $CLANG_FORMAT $file | diff $file -
+ tmp=`mktemp`
+ $CLANG_FORMAT $file > $tmp
+ diff -u $file $tmp || ok=no
+ rm $tmp
done
+ if [ $ok == no ]
+ then
+ false
+ fi
fi