This repository was archived by the owner on Jan 24, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ dist: trusty
66os :
77 - linux
88env :
9- - JOB=PRE_COMMIT
9+ - JOB=pre_commit
1010
1111addons :
1212 apt :
@@ -15,14 +15,17 @@ addons:
1515 - python
1616 - python-pip
1717 - python2.7-dev
18+ - clang-format-3.8
1819 ssh_known_hosts : 52.76.173.135
1920
2021before_install :
2122 - sudo pip install -U virtualenv pre-commit pip
2223
2324script :
2425 - exit_code=0
26+ - if [[ "$JOB" == "pre_commit" ]]; then sudo ln -s /usr/bin/clang-format-3.8 /usr/bin/clang-format; fi
2527 - .travis/pre_commit.sh || exit_code=$(( exit_code | $? ))
28+ - echo $exit_code
2629 - |
2730 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi;
2831 if [[ "$TRAVIS_BRANCH" != "develop" && ! "$TRAVIS_BRANCH" =~ ^v[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?(-\S*)?$ ]]; then echo "not develop branch, no deploy"; exit 0; fi;
@@ -31,6 +34,7 @@ script:
3134 cd ..
3235 curl $DEPLOY_DOCS_SH | bash -s $CONTENT_DEC_PASSWD $TRAVIS_BRANCH $MOBILE_DIR
3336 exit_code=$(( exit_code | $? ))
37+ echo $exit_code
3438 exit $exit_code
3539
3640notifications :
Original file line number Diff line number Diff line change 11#! /bin/bash
22function abort(){
3- echo " Your commit not fit PaddlePaddle code style" 1>&2
4- echo " Please use pre-commit scripts to auto-format your code" 1>&2
5- echo " Install pre-commit following 2 steps:" 1>&2
6- echo " 1> pip install pre-commit" 1>&2
7- echo " 2> pre-commit install (under the Mobile repo)" 1>&2
3+ echo " Your change doesn't follow PaddlePaddle's code style" 1>&2
4+ echo " Please use pre-commit to auto-format your code." 1>&2
85 exit 1
96}
107
@@ -14,6 +11,7 @@ cd `dirname $0`
1411cd ..
1512export PATH=/usr/bin:$PATH
1613pre-commit install
14+ clang-format --version
1715
1816if ! pre-commit run -a ; then
1917 ls -lh
You can’t perform that action at this time.
0 commit comments