-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbae7a5
commit e88cc8f
Showing
26 changed files
with
74 additions
and
112 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,17 @@ | ||
linters: | ||
enable: | ||
- errcheck | ||
- gofmt | ||
- govet | ||
- ineffassign | ||
- unconvert | ||
- staticcheck | ||
- gocyclo | ||
enable-all: false | ||
linters-settings: | ||
gocyclo: | ||
# Minimal code complexity to report. | ||
# Default: 30 (but we recommend 10-20) | ||
min-complexity: 100 | ||
run: | ||
timeout: 20m |
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 |
---|---|---|
|
@@ -3,51 +3,21 @@ GOPATH := $(shell go env GOPATH) | |
|
||
all: build | ||
|
||
getdeps: | ||
@echo "Installing golint" && go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
@echo "Installing gocyclo" && go install github.com/fzipp/gocyclo/cmd/gocyclo@latest | ||
@echo "Installing deadcode" && go install github.com/remyoudompheng/go-misc/deadcode@latest | ||
@echo "Installing misspell" && go install github.com/client9/misspell/cmd/misspell@latest | ||
@echo "Installing ineffassign" && go install github.com/gordonklaus/ineffassign@latest | ||
@echo "Installing staticcheck" && go install honnef.co/go/tools/cmd/staticcheck@latest | ||
|
||
verifiers: vet fmt lint cyclo spelling static #deadcode | ||
|
||
vet: | ||
@echo "Running $@" | ||
@go vet -atomic -bool -copylocks -nilfunc -printf -rangeloops -unreachable -unsafeptr -unusedresult ./... | ||
all: getdeps test | ||
|
||
fmt: | ||
@echo "Running $@" | ||
@gofmt -d . | ||
getdeps: | ||
@echo "Installing golangci-lint" && go get github.com/golangci/golangci-lint/cmd/golangci-lint && go install github.com/golangci/golangci-lint/cmd/golangci-lint | ||
go mod tidy | ||
|
||
lint: | ||
@echo "Running $@" | ||
@${GOPATH}/bin/golangci-lint run | ||
|
||
ineffassign: | ||
@echo "Running $@" | ||
@${GOPATH}/bin/ineffassign . | ||
|
||
cyclo: | ||
@echo "Running $@" | ||
@${GOPATH}/bin/gocyclo -over 100 . | ||
|
||
deadcode: | ||
@echo "Running $@" | ||
@${GOPATH}/bin/deadcode -test $(shell go list ./...) || true | ||
|
||
spelling: | ||
@${GOPATH}/bin/misspell -i "monitord,forumla,etherent" -error `find .` | ||
|
||
static: | ||
@${GOPATH}/bin/staticcheck -- ./... | ||
@${GOPATH}/bin/golangci-lint run -c ../.golangci.yml | ||
|
||
check: test | ||
test: verifiers build | ||
test: lint build | ||
go test -vet=off -v $(shell go list ./... | grep -Ev "stubs|network" ) | ||
|
||
testrace: verifiers build | ||
testrace: lint build | ||
go test -vet=off -v $(shell go list ./... | grep -Ev "stubs|network" ) | ||
|
||
generate: | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.