diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-02-14 16:19:16 +0000 |
---|---|---|
committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2013-02-14 16:19:16 +0000 |
commit | c38af887649c5185bb4f45fa1f54ba110d913e82 (patch) | |
tree | d7e472b28f3b50cf99eaf05ac6322eba47bfd794 /polly/utils | |
parent | 75f436c4ea0e2a6e881b2407ac75495465d71050 (diff) | |
download | llvm-c38af887649c5185bb4f45fa1f54ba110d913e82.tar.gz |
cmake: add command polly-check-format
This command runs clang-format on all files and reports formatting problems
llvm-svn: 175170
Diffstat (limited to 'polly/utils')
-rwxr-xr-x | polly/utils/check_format.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/polly/utils/check_format.sh b/polly/utils/check_format.sh new file mode 100755 index 000000000000..94a14a1873f2 --- /dev/null +++ b/polly/utils/check_format.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +OK=0 + +for ARG in "$@" + do + clang-format $1 | diff $1 - + + if [[ $? -eq 1 ]]; then + OK=1 + fi + done + +if [[ $OK -eq "1" ]]; then + echo "Error: clang-format reported formatting differences" +else + echo "OK: clang-format reported no formatting differences" +fi + |