未验证 提交 b0c17e76 编写于 作者: T tianshuo78520a 提交者: GitHub

[CHERRY-PICK2.0]add code format (#24074)

上级 f65c4b49
......@@ -270,20 +270,26 @@ 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
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
commit_files=off
fi
done
if [ $commit_files == 'off' ];then
echo "code format error"
exit 1
fi
trap : 0
}
......@@ -1133,6 +1139,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}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册