aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/clang-format-ci7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/clang-format-ci b/scripts/clang-format-ci
index 2051262..6854fc2 100755
--- a/scripts/clang-format-ci
+++ b/scripts/clang-format-ci
@@ -1,10 +1,15 @@
#!/bin/bash
+clangformat="clang-format"
+if [ -n "$1" ]; then
+ clangformat="clang-format-$1"
+fi
+
errors=0
paths=$(find . -type f -a '(' -name '*.c' -o -name '*.h' ')')
for path in $paths; do
in=$(cat $path)
- out=$(clang-format $path)
+ out=$($clangformat $path)
if [ "$in" != "$out" ]; then
diff -u -L $path -L "$path.formatted" $path - <<<$out