Skip to content

Commit 8c77016

Browse files
authored
Address all buf warnings (#44)
1 parent e37bb05 commit 8c77016

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4805
-4662
lines changed

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ endif
1010
PROTO_ROOT := temporal-proto
1111
COLOR := "\e[1;36m%s\e[0m\n"
1212
# List only subdirectories with *.proto files. Sort to remove duplicates.
13-
PROTO_DIRS = $(sort $(dir $(wildcard $(PROTO_ROOT)/*/*.proto)))
14-
PROTO_SERVICES = $(wildcard $(PROTO_ROOT)/*/service.proto)
13+
PROTO_DIRS = $(sort $(dir $(wildcard $(PROTO_ROOT)/*/*/*.proto)))
14+
PROTO_SERVICES = $(wildcard $(PROTO_ROOT)/*/*/service.proto)
1515
PROTO_OUT := .
1616
PROTO_IMPORT := $(PROTO_ROOT):$(GOPATH)/src/github.com/temporalio/gogo-protobuf/protobuf
1717

@@ -54,12 +54,12 @@ go-grpc: clean $(PROTO_OUT)
5454

5555
# All generated service files pathes relative to PROTO_OUT
5656
PROTO_GRPC_SERVICES = $(patsubst $(PROTO_OUT)/%,%,$(shell find $(PROTO_OUT) -name "service.pb.go"))
57-
dir_no_slash = $(patsubst %/,%,$(dir $(1)))
58-
dirname = $(notdir $(call dir_no_slash,$(1)))
57+
service_name = $(firstword $(subst /, ,$(1)))
58+
mock_file_name = $(call service_name,$(1))mock/$(subst $(call service_name,$(1))/,,$(1:go=mock.go))
5959

6060
grpc-mock:
6161
printf $(COLOR) "Generate gRPC mocks..."
62-
$(foreach PROTO_GRPC_SERVICE,$(PROTO_GRPC_SERVICES),cd $(PROTO_OUT) && mockgen -package $(call dirname,$(PROTO_GRPC_SERVICE))mock -source $(PROTO_GRPC_SERVICE) -destination $(call dir_no_slash,$(PROTO_GRPC_SERVICE))mock/$(notdir $(PROTO_GRPC_SERVICE:go=mock.go)) )
62+
$(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)) )
6363

6464
# Plugins & tools
6565

@@ -99,4 +99,4 @@ gomodtidy:
9999

100100
clean:
101101
printf $(COLOR) "Deleting generated go files..."
102-
rm -rf $(PROTO_OUT)/*/*.pb.*go
102+
rm -rf $(PROTO_OUT)/*/*/*.pb.*go

0 commit comments

Comments
 (0)