lint.sh 709 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. #set -x
  3. pkgs=`.rider/changepkgs.sh|grep -v ^vendor/`
  4. exitCode=$?
  5. if [[ ${exitCode} -ne 0 ]]; then
  6. echo ".rider/changepkgs.sh fail"
  7. exit ${exitCode}
  8. fi
  9. if [[ "${pkgs}" = "" ]]; then
  10. echo "no changepkgs"
  11. exit 0
  12. fi
  13. echo -e "change packages:\n${pkgs}\n"
  14. if [ ! -d "${CI_PROJECT_DIR}/../src" ];then
  15. mkdir ${CI_PROJECT_DIR}/../src
  16. fi
  17. ln -fs ${CI_PROJECT_DIR} ${CI_PROJECT_DIR}/../src
  18. export GOPATH=${CI_PROJECT_DIR}/..
  19. echo "GOPATH: $GOPATH"
  20. cd $GOPATH/src/go-common
  21. exitCode=0
  22. echo -e "\ngometalinter:"
  23. output=`gometalinter --config=.rider/.gometalinter.json ${pkgs}`
  24. exitCode=$?
  25. if [[ "${output}" != "" ]]; then
  26. exitCode=1
  27. echo -e "${output}"
  28. fi
  29. exit ${exitCode}