mirror of
https://github.com/spf13/cobra
synced 2025-05-07 22:07:23 +00:00
feat(travis-ci): use golangci-lint
deprecate go 1.10.x and 1.11.x
This commit is contained in:
parent
89c7ffb512
commit
37b6a19612
2 changed files with 35 additions and 14 deletions
25
.golangci.yml
Normal file
25
.golangci.yml
Normal 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
|
24
.travis.yml
24
.travis.yml
|
@ -1,28 +1,24 @@
|
||||||
language: go
|
language: go
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- diff
|
- lint
|
||||||
- test
|
- test
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.10.x
|
|
||||||
- 1.11.x
|
|
||||||
- 1.12.x
|
- 1.12.x
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
|
env: GO111MODULE=on
|
||||||
|
before_install: go get -u github.com/kyoh86/richgo
|
||||||
|
script:
|
||||||
|
- richgo test -v ./...
|
||||||
|
- go build
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- go: tip
|
- go: tip
|
||||||
include:
|
include:
|
||||||
- stage: diff
|
- stage: lint
|
||||||
go: 1.12.x
|
go: 1.12.x
|
||||||
script: diff -u <(echo -n) <(gofmt -d -s .)
|
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
|
||||||
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
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue