From 19235e8525eeca8241f35d52ad4c3429d98be70c Mon Sep 17 00:00:00 2001 From: tianshuo78520a <707759223@qq.com> Date: Mon, 20 Apr 2020 12:41:11 +0800 Subject: [PATCH] add cpu ci job check_style (#23617) --- paddle/scripts/paddle_build.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 720fc1812e1..76aec2ab757 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -270,20 +270,21 @@ function check_style() { eval "$(GIMME_GO_VERSION=1.8.3 gimme)" fi - pip install cpplint + + pip install cpplint pylint pytest astroid isort # set up go environment for running gometalinter mkdir -p $GOPATH/src/github.com/PaddlePaddle/ ln -sf ${PADDLE_ROOT} $GOPATH/src/github.com/PaddlePaddle/Paddle - export PATH=/usr/bin:$PATH pre-commit install clang-format --version - if ! pre-commit run -a ; then - git diff - exit 1 - fi - + 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 + fi + done trap : 0 } @@ -1133,6 +1134,7 @@ function main() { build ${parallel_number} ;; build_and_check) + check_style generate_upstream_develop_api_spec ${PYTHON_ABI:-""} ${parallel_number} cmake_gen ${PYTHON_ABI:-""} build ${parallel_number} -- GitLab