From 2951db0703f50c18a301b98df5b20c269fa97680 Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Fri, 2 Feb 2018 16:03:30 -0800 Subject: Change Golang formatter Moves from goimports to [goreturns](https://github.com/sqs/goreturns). This should not effect any code that already compiles as goreturns only adds zero return values, then runs goimports. This is mainly to help improve ergonomics when dealing with multiple return types. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a28522e..57c079e 100644 --- a/Makefile +++ b/Makefile @@ -130,8 +130,8 @@ update: # Format all the Go and C code .PHONY: format format-check format: - goimports -l -w $(GO_FILES) - clang-format -i -style=Google $(C_FILES) + @goreturns -l -w $(GO_FILES) + @clang-format -i -style=Google $(C_FILES) format-check: @goimports -d $(GO_FILES) \ @@ -170,7 +170,7 @@ go-tools: go get -u github.com/golang/protobuf/protoc-gen-go go get -u github.com/golang/lint/golint go get -u github.com/kardianos/govendor - go get -u golang.org/x/tools/cmd/goimports + go get -u sourcegraph.com/sqs/goreturns go get -u honnef.co/go/tools/cmd/megacheck ##### Setup/Teardown for integration tests (need root permissions) ##### -- cgit v1.2.3 From 78ec1b76d5dfd58bf244ee1426a6c86ed5fce118 Mon Sep 17 00:00:00 2001 From: Joseph Richey Date: Thu, 8 Feb 2018 01:44:09 -0800 Subject: dep: Update Travis to use dep Add dep instalation, remove govendor from go tools, and add a check for dependancies. --- Makefile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 57c079e..56fbff0 100644 --- a/Makefile +++ b/Makefile @@ -119,14 +119,6 @@ test: gen: protoc --go_out=. $(PROTO_FILES) -# Update the vendored dependencies. -.PHONY: update -update: - govendor init - govendor fetch +missing - govendor add +external - govendor remove +unused - # Format all the Go and C code .PHONY: format format-check format: @@ -169,7 +161,6 @@ uninstall: go-tools: go get -u github.com/golang/protobuf/protoc-gen-go go get -u github.com/golang/lint/golint - go get -u github.com/kardianos/govendor go get -u sourcegraph.com/sqs/goreturns go get -u honnef.co/go/tools/cmd/megacheck @@ -190,9 +181,10 @@ test-teardown: ##### Travis CI Commands .PHONY: travis-setup travis-script travis-install: go-tools test-setup + curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o $(GOPATH)/bin/dep + chmod +x $(GOPATH)/bin/dep go get -u github.com/mattn/goveralls travis-script: lint format-check test default goveralls -service=travis-ci - @govendor list +missing +external +unused \ - | ./input_fail.py "Incorrect vendored dependencies. Run \"make update\"." + dep status -- cgit v1.2.3