Skip to content

Commit f45db06

Browse files
committed
Add golangci-lint to Travis build
1 parent a6d2dee commit f45db06

File tree

2 files changed

+41
-5
lines changed

2 files changed

+41
-5
lines changed

.golangci.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[run]
2+
deadline = "10m"
3+
tests = true
4+
5+
[linters]
6+
disable-all = true
7+
enable = [
8+
"deadcode",
9+
"depguard",
10+
"errcheck",
11+
"goconst",
12+
"gocyclo",
13+
"gocritic",
14+
"gofmt",
15+
"golint",
16+
"gosec",
17+
"gosimple",
18+
"ineffassign",
19+
"maligned",
20+
"misspell",
21+
"nakedret",
22+
"staticcheck",
23+
"structcheck",
24+
"typecheck",
25+
"unconvert",
26+
"unparam",
27+
"varcheck",
28+
"vet",
29+
"vetshadow",
30+
]

.travis.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ matrix:
1717
allow_failures:
1818
- go: tip
1919

20-
before_install:
21-
- "if [[ $TRAVIS_GO_VERSION == 1.11 ]]; then go get -u golang.org/x/lint/golint; fi"
22-
2320
install:
2421
- go get -v -t ./...
2522

23+
before_script:
24+
- |
25+
if [[ $TRAVIS_GO_VERSION == 1.12 && $(arch) != 'ppc64le' ]]; then
26+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin
27+
golangci-lint run
28+
fi
29+
2630
script:
2731
- |
2832
if [ $(arch) == "ppc64le" ]; then
@@ -36,7 +40,9 @@ script:
3640
else
3741
go test -race -v -tags appengine
3842
fi
39-
- "if [[ $TRAVIS_GO_VERSION == 1.11 ]]; then go vet ./...; fi"
40-
- "if [[ $TRAVIS_GO_VERSION == 1.11 ]]; then golint .; fi"
43+
- |
44+
if [[ $TRAVIS_GO_VERSION == 1.12 && $(arch) != 'ppc64le' ]]; then
45+
golangci-lint run
46+
fi
4147
4248
sudo: false

0 commit comments

Comments
 (0)