backend-lint.sh 964 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. function exit_if_fail {
  3. command=$@
  4. echo "Executing '$command'"
  5. eval $command
  6. rc=$?
  7. if [ $rc -ne 0 ]; then
  8. echo "'$command' returned $rc."
  9. exit $rc
  10. fi
  11. }
  12. go get -u github.com/alecthomas/gometalinter
  13. go get -u github.com/tsenart/deadcode
  14. go get -u github.com/jgautheron/goconst/cmd/goconst
  15. go get -u github.com/gordonklaus/ineffassign
  16. go get -u github.com/opennota/check/cmd/structcheck
  17. go get -u github.com/mdempsky/unconvert
  18. go get -u github.com/opennota/check/cmd/varcheck
  19. go get -u honnef.co/go/tools/cmd/staticcheck
  20. go get -u github.com/mgechev/revive
  21. exit_if_fail gometalinter --enable-gc --vendor --deadline 10m --disable-all \
  22. --enable=deadcode \
  23. --enable=goconst \
  24. --enable=gofmt \
  25. --enable=ineffassign \
  26. --enable=structcheck \
  27. --enable=unconvert \
  28. --enable=varcheck \
  29. --enable=staticcheck
  30. exit_if_fail go vet ./pkg/...
  31. exit_if_fail revive -formatter stylish -config ./conf/revive.toml