feat(travis-ci): use golangci-lint

deprecate go 1.10.x and 1.11.x
This commit is contained in:
umarcor 2019-06-07 18:33:29 +02:00
parent 89c7ffb512
commit 37b6a19612
2 changed files with 35 additions and 14 deletions

25
.golangci.yml Normal file
View file

@ -0,0 +1,25 @@
run:
deadline: 5m
linters:
enable:
- deadcode
- errcheck
- gas
- goconst
- goimports
- golint
- govet
- ineffassign
- interfacer
- maligned
- megacheck
- structcheck
- unconvert
- varcheck
enable-all: false
disable-all: true
# presets:
# - bugs
# - unused
fast: false

View file

@ -1,28 +1,24 @@
language: go
stages:
- diff
- lint
- test
go:
- 1.10.x
- 1.11.x
- 1.12.x
- tip
env: GO111MODULE=on
before_install: go get -u github.com/kyoh86/richgo
script:
- richgo test -v ./...
- go build
matrix:
allow_failures:
- go: tip
include:
- stage: diff
- stage: lint
go: 1.12.x
script: diff -u <(echo -n) <(gofmt -d -s .)
before_install: go get -u github.com/kyoh86/richgo
script:
- richgo test -v ./...
- go build
- if [ -z $NOVET ]; then
diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint');
fi
before_install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin latest
script: golangci-lint run -v