diff options
Diffstat (limited to 'scripts/clang-format-ci')
-rwxr-xr-x | scripts/clang-format-ci | 7 |
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 |