Skip to content

Commit

Permalink
Remove -printf parameter from find (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin authored Aug 19, 2020
1 parent 8ab981e commit b004a85
Show file tree
Hide file tree
Showing 38 changed files with 147 additions and 116 deletions.
25 changes: 16 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$(VERBOSE).SILENT:
############################# Main targets #############################
# Install everything, update submodule, and compile proto files.
install: grpc-install mockgen-install update-proto
install: grpc-install mockgen-install goimports-install update-proto

# Compile proto files.
proto: grpc grpc-mock copyright
proto: grpc grpc-mock goimports copyright

# Update submodule and compile proto files.
update-proto: update-proto-submodule update-dependencies proto gomodtidy
update-proto: update-proto-submodule proto update-dependencies gomodtidy
########################################################################

##### Variables ######
Expand All @@ -29,11 +29,10 @@ PROTO_IMPORT := $(PROTO_ROOT):$(GOPATH)/src/github.com/temporalio/gogo-protobuf/
$(PROTO_OUT):
mkdir $(PROTO_OUT)

# git submodule for proto files

##### git submodule for proto files #####
update-proto-submodule:
printf $(COLOR) "Update proto-submodule..."
git submodule update --force --remote $(PROTO_ROOT)
git submodule update --init --force --remote $(PROTO_ROOT)

##### Compile proto files for go #####
grpc: gogo-grpc fix-path
Expand All @@ -58,9 +57,13 @@ grpc-mock:
printf $(COLOR) "Generate gRPC mocks..."
$(foreach PROTO_GRPC_SERVICE,$(PROTO_GRPC_SERVICES),cd $(PROTO_OUT) && mockgen -package $(call service_name,$(PROTO_GRPC_SERVICE))mock -source $(PROTO_GRPC_SERVICE) -destination $(call mock_file_name,$(PROTO_GRPC_SERVICE))$(NEWLINE) )

goimports:
@printf $(COLOR) "Run goimports..."
@goimports -w $(PROTO_OUT)

##### Plugins & tools #####
grpc-install: gogo-protobuf-install
printf $(COLOR) "Installing/updating gRPC plugins..."
printf $(COLOR) "Install/update gRPC plugins..."
GO111MODULE=off go get -u google.golang.org/grpc

gogo-protobuf-install: go-protobuf-install
Expand All @@ -70,9 +73,13 @@ go-protobuf-install:
GO111MODULE=off go get -u github.com/golang/protobuf/protoc-gen-go

mockgen-install:
printf $(COLOR) "Installing/updating mockgen..."
printf $(COLOR) "Install/update mockgen..."
GO111MODULE=off go get -u github.com/golang/mock/mockgen

goimports-install:
printf $(COLOR) "Install/update goimports..."
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports

##### License header #####
copyright:
printf $(COLOR) "Update license headers..."
Expand All @@ -91,4 +98,4 @@ gomodtidy:
clean:
printf $(COLOR) "Deleting generated go files..."
# Delete all directories with *.pb.go and *.mock.go files from $(PROTO_OUT)
$(foreach PROTO_OUT_DIR,$(shell find $(PROTO_OUT) \( -name "*.pb.go" -o -name "*.mock.go" \) -printf "%h\n" | sort -u),rm -rf $(dir $(PROTO_OUT_DIR)) )
find $(PROTO_OUT) \( -name "*.pb.go" -o -name "*.mock.go" \) | xargs dirname | sort -u | xargs rm -rf
13 changes: 7 additions & 6 deletions command/v1/message.pb.go

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

13 changes: 7 additions & 6 deletions common/v1/message.pb.go

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

3 changes: 2 additions & 1 deletion dependencies/gogoproto/gogo.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/command_type.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/common.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/event_type.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/failed_cause.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/namespace.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/query.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/task_queue.pb.go

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

3 changes: 2 additions & 1 deletion enums/v1/workflow.pb.go

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

3 changes: 2 additions & 1 deletion errordetails/v1/message.pb.go

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

7 changes: 4 additions & 3 deletions failure/v1/message.pb.go

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

11 changes: 6 additions & 5 deletions filter/v1/message.pb.go

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

13 changes: 7 additions & 6 deletions history/v1/message.pb.go

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

13 changes: 7 additions & 6 deletions namespace/v1/message.pb.go

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

7 changes: 4 additions & 3 deletions query/v1/message.pb.go

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

3 changes: 2 additions & 1 deletion replication/v1/message.pb.go

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

6 changes: 3 additions & 3 deletions serviceerror/canceled.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type (
// Canceled represents canceled error.
Canceled struct {
Message string
st *status.Status
st *status.Status
}
)

Expand All @@ -48,7 +48,7 @@ func (e *Canceled) Error() string {
}

func (e *Canceled) status() *status.Status {
if e.st != nil{
if e.st != nil {
return e.st
}

Expand All @@ -58,6 +58,6 @@ func (e *Canceled) status() *status.Status {
func newCanceled(st *status.Status) *Canceled {
return &Canceled{
Message: st.Message(),
st: st,
st: st,
}
}
Loading

0 comments on commit b004a85

Please sign in to comment.