From 109ffffbb2658883bf4ab3ef3e0065a77a52f1f0 Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Wed, 22 Apr 2020 15:52:37 +0800 Subject: [PATCH] Update code format (#24000) --- paddle/scripts/paddle_build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 76aec2ab75..82c2d44a66 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -279,12 +279,18 @@ function check_style() { pre-commit install clang-format --version + commit_files=on for file_name in `git diff --numstat upstream/$BRANCH |awk '{print $NF}'`;do if ! pre-commit run --files $file_name ; then git diff - exit 1 + commit_files=off fi done + + if [ $commit_files == 'off' ];then + echo "code format error" + exit 1 + fi trap : 0 } -- GitLab