summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2021-01-31 20:55:56 -0500
committerGitHub <noreply@github.com>2021-01-31 20:55:56 -0500
commitb595f0d0bf2bde1d0e55cc1f6cfc5df71cb07d98 (patch)
tree6915f8a899fae0c67737fad7f7f7274a0b48ab2c /tools
parentf1924e91f4a1ea1dea62b4fb0a1342f94a55ccfe (diff)
fix clang-format check (#110)
Diffstat (limited to 'tools')
-rw-r--r--tools/clang-format-check.sh14
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