From 37624b30ff3b769fdd768c77d2cdd8b55f09481c Mon Sep 17 00:00:00 2001 From: Helin Wang Date: Sat, 15 Jul 2017 00:01:12 +0000 Subject: [PATCH] Fix Go pre-commit --- .pre-commit-config.yaml | 4 +--- paddle/scripts/travis/check_style.sh | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 44174d3558fb7..b7179c26feeda 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,11 +22,9 @@ hooks: - id: clang-formater - repo: https://github.com/PaddlePaddle/pre-commit-golang - sha: 6bce8cc8a6ce601bcf6feccf6bfbd43fe04ccbeb + sha: fb3ba0e9e38a516543925e96cef76740b61321ab hooks: - id: go-fmt types: [go] - - id: go-lint - types: [go] - id: gometalinter types: [go] diff --git a/paddle/scripts/travis/check_style.sh b/paddle/scripts/travis/check_style.sh index 4754bdd4c80de..8049aeb7b0087 100755 --- a/paddle/scripts/travis/check_style.sh +++ b/paddle/scripts/travis/check_style.sh @@ -13,6 +13,11 @@ export PATH=/usr/bin:$PATH pre-commit install clang-format --version +# set up go environment for running gometalinter +mkdir -p $GOPATH/src/github.com/PaddlePaddle/ +ln -sf $TRAVIS_BUILD_DIR $GOPATH/src/github.com/PaddlePaddle/Paddle +cd $GOPATH/src/github.com/PaddlePaddle/Paddle/go; glide install; cd - + if ! pre-commit run -a ; then git diff --exit-code fi