Skip to content

Commit

Permalink
Update dependencies/prune; change to golangci-lint for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Sep 21, 2018
1 parent 6f7640b commit 5b5e57f
Show file tree
Hide file tree
Showing 45 changed files with 1,865 additions and 8,968 deletions.
37 changes: 37 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 10m

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
#- ".*\\.my\\.go$"
#- lib/bad.go

linters:
enable:
- deadcode
- errcheck
- goconst
- gofmt
- goimports
- golint
- gosimple
- govet
- ineffassign
- megacheck
- misspell
- staticcheck
- structcheck
- varcheck
disable-all: true

issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- "composite literal uses unkeyed fields"
17 changes: 10 additions & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[prune]
go-tests = true
unused-packages = true
non-go = true

[[constraint]]
name = "github.com/stretchr/testify"
version = "~v1.2.2"
24 changes: 7 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
GOTOOLS = \
github.com/golang/dep/cmd/dep \
github.com/golangci/golangci-lint/cmd/golangci-lint \
golang.org/x/tools/cmd/cover \

.PHONY: setup
setup: ## Install all the build and lint dependencies
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/alecthomas/gometalinter
go get -u golang.org/x/tools/cmd/cover
gometalinter --install
go get -u $(GOTOOLS)

.PHONY: dep
dep: ## Install all import dependencies
Expand All @@ -23,19 +25,7 @@ fmt: ## gofmt and goimports all go files

.PHONY: lint
lint: ## Run all the linters
gometalinter --vendor --disable-all \
--enable=deadcode \
--enable=ineffassign \
--enable=gosimple \
--enable=staticcheck \
--enable=gofmt \
--enable=goimports \
--enable=misspell \
--enable=errcheck \
--enable=vet \
--enable=vetshadow \
--deadline=10m \
./...
golangci-lint run

.PHONY: ci
ci: lint test ## Run all the tests and code checks
Expand Down
22 changes: 0 additions & 22 deletions vendor/github.com/davecgh/go-spew/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/github.com/davecgh/go-spew/.travis.yml

This file was deleted.

205 changes: 0 additions & 205 deletions vendor/github.com/davecgh/go-spew/README.md

This file was deleted.

22 changes: 0 additions & 22 deletions vendor/github.com/davecgh/go-spew/cov_report.sh

This file was deleted.

Loading

0 comments on commit 5b5e57f

Please sign in to comment.