Skip to content

Commit 70fee1e

Browse files
committed
Add golangci-lint in .travis.yml
1 parent 753f2dc commit 70fee1e

File tree

7 files changed

+22
-31
lines changed

7 files changed

+22
-31
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
sudo: false
22
language: go
33
install:
4-
- go get golang.org/x/tools/cmd/goimports
5-
- go get github.com/go-critic/go-critic/...
4+
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.11.2
65
go:
76
- "1.11"
87
before_script:

Makefile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
fulllint: fmtcheck importscheck vetcheck gocriticcheck
1+
default: golangci-lint test
22

33
test:
44
@sh -c "'$(CURDIR)/scripts/test.sh'"
55

6-
vetcheck:
7-
@sh -c "'$(CURDIR)/scripts/vet.sh'"
6+
golangci-lint:
7+
@sh -c "'$(CURDIR)/scripts/golangci-lint.sh'"
88

9-
gocriticcheck:
10-
@sh -c "'$(CURDIR)/scripts/gocritic.sh'"
11-
12-
fmtcheck:
13-
@sh -c "'$(CURDIR)/scripts/format.sh'"
14-
15-
importscheck:
16-
@sh -c "'$(CURDIR)/scripts/import.sh'"
17-
18-
.PHONY: fulllint test vetcheck gocriticcheck fmtcheck importscheck
9+
.PHONY: test golangci-lint

scripts/format.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/gocritic.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/golangci-lint.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
echo "==> Running 'golangci-lint' ..."
4+
golangci-lint run \
5+
--enable golint \
6+
--enable interfacer \
7+
--enable unconvert \
8+
--enable goconst \
9+
--enable gocyclo \
10+
--enable gofmt \
11+
--enable goimports \
12+
--enable depguard \
13+
--enable unparam \
14+
--enable nakedret \
15+
--enable prealloc \
16+
--enable gocritic \
17+
./...

scripts/import.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/vet.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)