Skip to content

Commit

Permalink
Switch to golangci-lint from gometalinter.
Browse files Browse the repository at this point in the history
Hoping that this is more stable.
  • Loading branch information
lkysow committed Feb 6, 2019
1 parent 84c89ba commit 2225da9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- checkout
- run: make test-coverage
- run: make check-fmt
- run: make check-gometalint
- run: make check-lint
- run:
name: post coverage to codecov.io
command: bash <(curl -s https://codecov.io/bash)
Expand Down
21 changes: 21 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
linters:
enable:
- deadcode
- errcheck
- gochecknoinits
# We don't use goconst because it gives false positives in the tests.
# - goconst
- gofmt
- golint
- gosec
- gosimple
- ineffassign
- interfacer
- staticcheck
- structcheck
- typecheck
- unconvert
- unused
- varcheck
- vet
- vetshadow
44 changes: 0 additions & 44 deletions .gometalinter.json

This file was deleted.

19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,12 @@ release: ## Create packages for a release
fmt: ## Run goimports (which also formats)
goimports -w $$(find . -type f -name '*.go' ! -path "./vendor/*" ! -path "./server/static/bindata_assetfs.go" ! -path "**/mocks/*")

gometalint: ## Run every linter ever
# gotype and gotypex are disabled because they don't pass on CI and https://github.com/alecthomas/gometalinter/issues/206
# maligned is disabled because I'd rather have alphabetical struct fields than save a few bytes
# gocyclo is temporarily disabled because we don't pass it right now
# golint is temporarily disabled because we need to add comments everywhere first
# CGO_ENABLED=0 is attempted workaround for https://github.com/alecthomas/gometalinter/issues/149
CGO_ENABLED=0 gometalinter --config=.gometalinter.json ./...

gometalint-install: ## Install gometalint
go get -u github.com/alecthomas/gometalinter
gometalinter --install

check-gometalint: gometalint-install gometalint
lint: ## Run linter
golangci-lint run

check-lint:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b ./bin v1.13.2
./bin/golangci-lint run

check-fmt: ## Fail if not formatted
go get golang.org/x/tools/cmd/goimports
Expand Down

0 comments on commit 2225da9

Please sign in to comment.