forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from gometalinter.v2 to golangci-lint (thrasher-corp#249)
* Migrate from gometalinter.v2 to golangci-lint
- Loading branch information
Showing
133 changed files
with
2,177 additions
and
2,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
run: | ||
deadline: 30s | ||
issues-exit-code: 1 | ||
tests: true | ||
skip-dirs: | ||
- vendor | ||
- web | ||
- testdata | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# defaults | ||
- govet | ||
# - errcheck | ||
- staticcheck | ||
# - unused | ||
- gosimple | ||
- structcheck | ||
# - varcheck | ||
- ineffassign | ||
# - deadcode | ||
- typecheck | ||
- goimports | ||
- govet | ||
|
||
# disabled by default linters | ||
- golint | ||
- stylecheck | ||
- gosec | ||
# - interfacer | ||
- unconvert | ||
# - dupl | ||
- goconst | ||
# - gocyclo | ||
- gofmt | ||
- goimports | ||
# - maligned | ||
- depguard | ||
- misspell | ||
# - lll | ||
- unparam | ||
- nakedret | ||
# - prealloc | ||
- scopelint | ||
- gocritic | ||
# - gochecknoinits | ||
# - gochecknoglobals | ||
|
||
linters-settings: | ||
govet: | ||
check-shadowing: true | ||
golint: | ||
min-confidence: 0 | ||
goconst: | ||
min-occurrences: 6 | ||
depguard: | ||
list-type: blacklist | ||
# lll: | ||
# line-length: 80 # NOTE: we'll enforce this at a later point | ||
gocritic: | ||
enabled-tags: | ||
- performance | ||
- style | ||
- experimental | ||
disabled-checks: | ||
- wrapperFunc | ||
- hugeParam | ||
- importShadow | ||
- rangeValCopy | ||
- methodExprCall | ||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
exclude-rules: | ||
- text: "weak cryptographic primitive" | ||
linters: | ||
- gosec | ||
|
||
service: | ||
golangci-lint-version: 1.15.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ matrix: | |
|
||
- language: go | ||
go: | ||
- 1.11.x | ||
- 1.12.x | ||
env: | ||
- GO111MODULE=on | ||
install: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,15 @@ | ||
LDFLAGS = -ldflags "-w -s" | ||
GCTPKG = github.com/thrasher-/gocryptotrader | ||
LINTPKG = gopkg.in/alecthomas/gometalinter.v2 | ||
LINTBIN = $(GOPATH)/bin/gometalinter.v2 | ||
ENABLELLL = false | ||
LINTOPTS = \ | ||
--disable-all \ | ||
--enable=gofmt \ | ||
--enable=vet \ | ||
--enable=vetshadow \ | ||
--enable=misspell \ | ||
--enable=golint \ | ||
--enable=ineffassign \ | ||
--enable=goconst \ | ||
--enable=structcheck \ | ||
--enable=unparam \ | ||
--enable=gosimple \ | ||
--enable=unconvert | ||
ifeq ($(ENABLELLL), true) | ||
LINTOPTS += \ | ||
--enable=lll \ | ||
--line-length=80 | ||
endif | ||
LINTOPTS += \ | ||
--deadline=5m ./... | \ | ||
tee /dev/stderr | ||
LINTPKG = github.com/golangci/golangci-lint/cmd/[email protected] | ||
LINTBIN = $(GOPATH)/bin/golangci-lint | ||
|
||
get: | ||
GO111MODULE=on go get $(GCTPKG) | ||
|
||
linter: | ||
GO111MODULE=on go get $(GCTPKG) | ||
GO111MODULE=off go get -u $(LINTPKG) | ||
$(LINTBIN) --install | ||
test -z "$$($(LINTBIN) $(LINTOPTS))" | ||
GO111MODULE=on go get $(LINTPKG) | ||
test -z "$$($(LINTBIN) run --verbose | tee /dev/stderr)" | ||
|
||
check: linter test | ||
|
||
|
@@ -46,4 +23,10 @@ install: | |
GO111MODULE=on go install $(LDFLAGS) | ||
|
||
fmt: | ||
gofmt -l -w -s $(shell find . -type f -name '*.go') | ||
gofmt -l -w -s $(shell find . -type f -name '*.go') | ||
|
||
update_deps: | ||
GO111MODULE=on go mod verify | ||
GO111MODULE=on go mod tidy | ||
rm -rf vendor | ||
GO111MODULE=on go mod vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.