From 0185d7a1e7c6008d2005e5e1e0e412c4f3fba1ef Mon Sep 17 00:00:00 2001 From: andreyla Date: Fri, 17 Jul 2020 21:47:21 +0300 Subject: [PATCH 1/3] Create clang-format.sh --- clang-format.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 clang-format.sh diff --git a/clang-format.sh b/clang-format.sh new file mode 100644 index 0000000000..398e7d5246 --- /dev/null +++ b/clang-format.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +if [[ -z $CLANG_FORMAT ]] ; then + CLANG_FORMAT=clang-format +fi + +if NOT type $CLANG_FORMAT 2> /dev/null ; then + echo "No appropriate clang-format found." + exit 1 +fi + +FAIL=0 +SOURCE_FILES=`find . -type f \( -name '*.h' -name '*.hpp' -o -name '*.cpp' -o -name '*.c' \)` +for i in $SOURCE_FILES +do + $CLANG_FORMAT -style=llvm $i | grep -c " /dev/null + if [ $? -ne 1 ] + then + echo "$i failed clang-format check." + FAIL=1 + fi +done +if [ $FAIL -ne 0 ] +then + echo "Clang-format check failed!" +fi + +exit $FAIL + From fd79707ac66265bb2521c601acaa9f4aadc8dd94 Mon Sep 17 00:00:00 2001 From: andreyla Date: Tue, 21 Jul 2020 14:16:14 +0300 Subject: [PATCH 2/3] Update clang-format.sh Changed the style of formatting on 'google' --- clang-format.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-format.sh b/clang-format.sh index 398e7d5246..604f2f6676 100644 --- a/clang-format.sh +++ b/clang-format.sh @@ -13,7 +13,7 @@ FAIL=0 SOURCE_FILES=`find . -type f \( -name '*.h' -name '*.hpp' -o -name '*.cpp' -o -name '*.c' \)` for i in $SOURCE_FILES do - $CLANG_FORMAT -style=llvm $i | grep -c " /dev/null + $CLANG_FORMAT -style=google $i | grep -c " /dev/null if [ $? -ne 1 ] then echo "$i failed clang-format check." From 754ed97824eaa6b8441d8a623d2bd74282c2f506 Mon Sep 17 00:00:00 2001 From: andreyla Date: Mon, 27 Jul 2020 19:09:02 +0300 Subject: [PATCH 3/3] Delete clang-format.sh --- clang-format.sh | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 clang-format.sh diff --git a/clang-format.sh b/clang-format.sh deleted file mode 100644 index 604f2f6676..0000000000 --- a/clang-format.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -if [[ -z $CLANG_FORMAT ]] ; then - CLANG_FORMAT=clang-format -fi - -if NOT type $CLANG_FORMAT 2> /dev/null ; then - echo "No appropriate clang-format found." - exit 1 -fi - -FAIL=0 -SOURCE_FILES=`find . -type f \( -name '*.h' -name '*.hpp' -o -name '*.cpp' -o -name '*.c' \)` -for i in $SOURCE_FILES -do - $CLANG_FORMAT -style=google $i | grep -c " /dev/null - if [ $? -ne 1 ] - then - echo "$i failed clang-format check." - FAIL=1 - fi -done -if [ $FAIL -ne 0 ] -then - echo "Clang-format check failed!" -fi - -exit $FAIL -