diff --git a/.reviewdog.yml b/.reviewdog.yml new file mode 100644 index 00000000..1a55909f --- /dev/null +++ b/.reviewdog.yml @@ -0,0 +1,41 @@ +--- +runner: + golint: + cmd: golint $(go list ./... | grep -v mock_) + format: golint + govet: + cmd: go vet $(go list ./... | grep -v mock_) + format: govet + unused: + cmd: unused $(go list ./... | grep -v mock_) + errorformat: + - "%f:%l:%c: %m" + errcheck: + cmd: errcheck -asserts -ignoretests -blank $(go list ./... | grep -v mock_) + errorformat: + - "%f:%l:%c:%m" + gosimple: + cmd: gosimple $(go list ./... | grep -v mock_) + errorformat: + - "%f:%l:%c: %m" + staticcheck: + cmd: staticcheck $(go list ./... | grep -v mock_) + errorformat: + - "%f:%l:%c: %m" + misspell: + cmd: misspell $(git ls-files) + errorformat: + - "%f:%l:%c: %m" + unparam: + cmd: unparam $(go list ./... | grep -v mock_) + errorformat: + - "%f:%l:%c: %m" + revive: + cmd: revive -config=.revive.toml $(go list ./... | grep -v mock_) + format: golint + golangci: + cmd: golangci-lint run --out-format=line-number ./... + errorformat: + - '%E%f:%l:%c: %m' + - '%E%f:%l: %m' + - '%C%.%#' \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 662a7642..49bd1506 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,8 @@ go: - "1.11" env: - - GO111MODULE=on + global: + - GO111MODULE=on cache: directories: @@ -27,6 +28,18 @@ after_success: # for coverage report - GO111MODULE=off go get -u github.com/mattn/goveralls - if [ "$TRAVIS_GO_VERSION" = "1.11" ]; then goveralls -service=travis-ci -coverprofile=cover.out -ignore=main.go; fi + # for reviewdog + - GO111MODULE=off go get -u github.com/haya14busa/reviewdog/cmd/reviewdog + - GO111MODULE=off go get github.com/golang/lint/golint + - GO111MODULE=off go get github.com/kisielk/errcheck + - GO111MODULE=off go get honnef.co/go/tools/cmd/gosimple + - GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck + - GO111MODULE=off go get honnef.co/go/tools/cmd/unused + - GO111MODULE=off go get github.com/client9/misspell/cmd/misspell + - GO111MODULE=off go get mvdan.cc/unparam + - GO111MODULE=off go get github.com/mgechev/revive + - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin + - if [ "$TRAVIS_GO_VERSION" = "1.11" ]; then reviewdog -reporter=github-pr-check; fi before_deploy: # copy dependencies to vendor - go mod vendor