Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-08-31 10:04:45 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-08-31 10:04:45 +0300
commit27c3563ac0210ed3a1b610b68ef45f2335ad02be (patch)
treef3d1b0a9ce9a5b1fe500495e731d7319f394ead6
parentd924490032231edb9452acdaca7d8e4747cf6ab4 (diff)
Makefile: Fix Go sources not including protoc-gen-gitaly plugin
When executing the formatter, we use `find_go_sources` to find the set of Go files which should be formatted. This function excludes a bunch of files which shouldn't ever be formatted, like for example generated protobuf files. These exclusions have been too broad though and caused us to never format sources of our protoc-gen-gitaly command, which is also contained in "proto/go/". Fix this by only excluding "proto/go/gitalypb/", which contains all generated sources, and run the formatter on the newly found sources.
-rw-r--r--Makefile2
-rw-r--r--proto/go/internal/cmd/protoc-gen-gitaly/main.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6198fe1c5..91b3b1944 100644
--- a/Makefile
+++ b/Makefile
@@ -182,7 +182,7 @@ find_commands = $(notdir $(shell find ${SOURCE_DIR}/cmd -mindepth 1 -max
# Find all command binaries.
find_command_binaries = $(addprefix ${BUILD_DIR}/bin/, $(shell ls ${BUILD_DIR}/bin))
# Find all Go source files.
-find_go_sources = $(shell find ${SOURCE_DIR} -type d \( -name ruby -o -name vendor -o -name testdata -o -name '_*' -o -path '*/proto/go' \) -prune -o -type f -name '*.go' -not -name '*.pb.go' -print | sort -u)
+find_go_sources = $(shell find ${SOURCE_DIR} -type d \( -name ruby -o -name vendor -o -name testdata -o -name '_*' -o -path '*/proto/go/gitalypb' \) -prune -o -type f -name '*.go' -not -name '*.pb.go' -print | sort -u)
# run_go_tests will execute Go tests with all required parameters. Its
# behaviour can be modified via the following variables:
diff --git a/proto/go/internal/cmd/protoc-gen-gitaly/main.go b/proto/go/internal/cmd/protoc-gen-gitaly/main.go
index b16b88b22..40499a1fa 100644
--- a/proto/go/internal/cmd/protoc-gen-gitaly/main.go
+++ b/proto/go/internal/cmd/protoc-gen-gitaly/main.go
@@ -182,7 +182,7 @@ func generateProtolistGo(req *pluginpb.CodeGeneratorRequest) error {
// renderProtoList generate a go file with a list of gitaly protos
func renderProtoList(dest io.WriteCloser, protoNames []string) error {
- var joinFunc = template.FuncMap{"join": strings.Join}
+ joinFunc := template.FuncMap{"join": strings.Join}
protoList := `package gitalypb
// Code generated by protoc-gen-gitaly. DO NOT EDIT