diff --git a/Makefile b/Makefile index d80410ff1..45d0450a7 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,36 @@ -.PHONY: all test get_deps +.PHONY: all build test fmt lint get_deps all: protoc install test NOVENDOR = go list github.com/tendermint/abci/... | grep -v /vendor/ protoc: - protoc --go_out=plugins=grpc:. types/*.proto + @ protoc --go_out=plugins=grpc:. types/*.proto install: - go install github.com/tendermint/abci/cmd/... + @ go install github.com/tendermint/abci/cmd/... + +build: + @ go build -i github.com/tendermint/abci/cmd/... test: - go test `${NOVENDOR}` - bash tests/test.sh + @ go test `${NOVENDOR}` + @ bash tests/test.sh + +fmt: + @ go fmt ./... + +lint: + @ go get -u github.com/golang/lint/golint + @ for file in $$(find "." -name '*.go' | grep -v '/vendor/' | grep -v '\.pb\.go'); do \ + golint -set_exit_status $${file}; \ + done; test_integrations: get_vendor_deps install test get_deps: - go get -d `${NOVENDOR}` + @ go get -d `${NOVENDOR}` get_vendor_deps: - go get github.com/Masterminds/glide - glide install + @ go get github.com/Masterminds/glide + @ glide install diff --git a/client/client.go b/client/client.go index 8ea295937..cdeb4db0f 100644 --- a/client/client.go +++ b/client/client.go @@ -4,8 +4,8 @@ import ( "fmt" "sync" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) type Client interface { diff --git a/client/grpc_client.go b/client/grpc_client.go index 566ee183e..1a0e11d2e 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -8,8 +8,8 @@ import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) // A stripped copy of the remoteClient that makes diff --git a/client/local_client.go b/client/local_client.go index b787eb365..33dd619be 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -3,8 +3,8 @@ package abcicli import ( "sync" - . "github.com/tendermint/go-common" types "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) type localClient struct { diff --git a/client/socket_client.go b/client/socket_client.go index 9b4f9aed4..744b6c0c8 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -10,8 +10,8 @@ import ( "sync" "time" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) const ( diff --git a/cmd/counter/main.go b/cmd/counter/main.go index 218224a0a..0714380b4 100644 --- a/cmd/counter/main.go +++ b/cmd/counter/main.go @@ -3,9 +3,9 @@ package main import ( "flag" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/example/counter" "github.com/tendermint/abci/server" + . "github.com/tendermint/go-common" ) func main() { diff --git a/cmd/dummy/main.go b/cmd/dummy/main.go index aecb1138f..8167c3541 100644 --- a/cmd/dummy/main.go +++ b/cmd/dummy/main.go @@ -3,10 +3,10 @@ package main import ( "flag" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/example/dummy" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { diff --git a/example/chain_aware/chain_aware_app.go b/example/chain_aware/chain_aware_app.go index e3543f13c..85ea7129d 100644 --- a/example/chain_aware/chain_aware_app.go +++ b/example/chain_aware/chain_aware_app.go @@ -3,9 +3,9 @@ package main import ( "flag" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { diff --git a/example/chain_aware/chain_aware_test.go b/example/chain_aware/chain_aware_test.go index f5283a386..942c9ba9c 100644 --- a/example/chain_aware/chain_aware_test.go +++ b/example/chain_aware/chain_aware_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/client" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func TestChainAware(t *testing.T) { diff --git a/example/counter/counter.go b/example/counter/counter.go index 90be6d92b..1249f667a 100644 --- a/example/counter/counter.go +++ b/example/counter/counter.go @@ -3,8 +3,8 @@ package counter import ( "encoding/binary" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) type CounterApplication struct { diff --git a/example/dummy/dummy_test.go b/example/dummy/dummy_test.go index d22943472..f745d2ead 100644 --- a/example/dummy/dummy_test.go +++ b/example/dummy/dummy_test.go @@ -6,10 +6,10 @@ import ( "sort" "testing" + "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" "github.com/tendermint/go-crypto" "github.com/tendermint/go-wire" - "github.com/tendermint/abci/types" ) func testDummy(t *testing.T, dummy types.Application, tx []byte, key, value string) { diff --git a/example/dummy/persistent_dummy.go b/example/dummy/persistent_dummy.go index fa730bcb5..550c5969f 100644 --- a/example/dummy/persistent_dummy.go +++ b/example/dummy/persistent_dummy.go @@ -6,11 +6,11 @@ import ( "strconv" "strings" + "github.com/tendermint/abci/types" . "github.com/tendermint/go-common" dbm "github.com/tendermint/go-db" "github.com/tendermint/go-merkle" "github.com/tendermint/go-wire" - "github.com/tendermint/abci/types" ) const ( diff --git a/example/example_test.go b/example/example_test.go index 1ddefddb5..fb15f503b 100644 --- a/example/example_test.go +++ b/example/example_test.go @@ -10,12 +10,12 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/client" "github.com/tendermint/abci/example/dummy" nilapp "github.com/tendermint/abci/example/nil" "github.com/tendermint/abci/server" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func TestDummy(t *testing.T) { diff --git a/server/grpc_server.go b/server/grpc_server.go index 1acd45a36..07704c321 100644 --- a/server/grpc_server.go +++ b/server/grpc_server.go @@ -6,8 +6,8 @@ import ( "google.golang.org/grpc" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 diff --git a/server/server.go b/server/server.go index 496767470..6de8747b7 100644 --- a/server/server.go +++ b/server/server.go @@ -3,8 +3,8 @@ package server import ( "fmt" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func NewServer(protoAddr, transport string, app types.Application) (Service, error) { diff --git a/server/socket_server.go b/server/socket_server.go index bd26a18a8..1ef47859f 100644 --- a/server/socket_server.go +++ b/server/socket_server.go @@ -8,8 +8,8 @@ import ( "strings" "sync" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) // var maxNumberConnections = 2 diff --git a/tests/benchmarks/parallel/parallel.go b/tests/benchmarks/parallel/parallel.go index 5960d529a..51d9a6366 100644 --- a/tests/benchmarks/parallel/parallel.go +++ b/tests/benchmarks/parallel/parallel.go @@ -5,8 +5,8 @@ import ( "fmt" //"encoding/hex" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { diff --git a/tests/benchmarks/simple/simple.go b/tests/benchmarks/simple/simple.go index fb536730c..b1b71fb72 100644 --- a/tests/benchmarks/simple/simple.go +++ b/tests/benchmarks/simple/simple.go @@ -8,8 +8,8 @@ import ( "reflect" //"encoding/hex" - . "github.com/tendermint/go-common" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" ) func main() { diff --git a/tests/test_app/app.go b/tests/test_app/app.go index 59d5b0e70..b84b9386f 100644 --- a/tests/test_app/app.go +++ b/tests/test_app/app.go @@ -5,10 +5,10 @@ import ( "os" "time" - . "github.com/tendermint/go-common" - "github.com/tendermint/go-process" "github.com/tendermint/abci/client" "github.com/tendermint/abci/types" + . "github.com/tendermint/go-common" + "github.com/tendermint/go-process" ) //---------------------------------------- diff --git a/testutil/messages.go b/testutil/messages.go index 1036e48e4..0cdddb443 100644 --- a/testutil/messages.go +++ b/testutil/messages.go @@ -1,8 +1,8 @@ package testutil import ( - "github.com/tendermint/go-crypto" "github.com/tendermint/abci/types" + "github.com/tendermint/go-crypto" ) //----------------------------------------