diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/clang-format-check.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/clang-format-check.sh b/tools/clang-format-check.sh new file mode 100644 index 0000000000..52f09a1332 --- /dev/null +++ b/tools/clang-format-check.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +clangFormatTargets=$(find . -type f -regex '.*\.\(cpp\|hpp\|h\|cc\|cxx\)') + +for inputFile in $clangFormatTargets +do + clang-format-10 -style=file $inputFile > $inputFile-formatted + diff $inputFile $inputFile-formatted + if [ $? != 0 ] ; then + exit 1 + else + rm $inputFile-formatted + fi +done |
