Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Add reviewdog settings #106

Merged
merged 2 commits into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .reviewdog.yml
Original file line number Diff line number Diff line change
@@ -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%.%#'
15 changes: 14 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ go:
- "1.11"

env:
- GO111MODULE=on
global:
- GO111MODULE=on

cache:
directories:
Expand All @@ -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
Expand Down