22
33# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44#
5- # Generated on 2022-04-12T21:42:27Z by kres 4975f30 .
5+ # Generated on 2022-04-22T17:30:48Z by kres 685be7b-dirty .
66
77ARG TOOLCHAIN
88
@@ -37,10 +37,10 @@ ENV GOPATH /go
3737RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b /bin v1.45.2
3838ARG GOFUMPT_VERSION
3939RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
40- && mv /go/bin/gofumpt /bin/gofumpt
40+ && mv /go/bin/gofumpt /bin/gofumpt
4141ARG GOIMPORTS_VERSION
4242RUN go install golang.org/x/tools/cmd/goimports@${GOIMPORTS_VERSION} \
43- && mv /go/bin/goimports /bin/goimports
43+ && mv /go/bin/goimports /bin/goimports
4444ARG PROTOBUF_GO_VERSION
4545RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOBUF_GO_VERSION}
4646RUN mv /go/bin/protoc-gen-go /bin
@@ -50,6 +50,9 @@ RUN mv /go/bin/protoc-gen-go-grpc /bin
5050ARG GRPC_GATEWAY_VERSION
5151RUN go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION}
5252RUN mv /go/bin/protoc-gen-grpc-gateway /bin
53+ ARG VTPROTOBUF_VERSION
54+ RUN go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@v${VTPROTOBUF_VERSION}
55+ RUN mv /go/bin/protoc-gen-go-vtproto /bin
5356
5457# tools and sources
5558FROM tools AS base
@@ -66,15 +69,17 @@ RUN --mount=type=cache,target=/go/pkg go list -mod=readonly all >/dev/null
6669# runs protobuf compiler
6770FROM tools AS proto-compile
6871COPY --from=proto-specs / /
69- RUN protoc -I/api --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --experimental_allow_proto3_optional /api/v1alpha1/resource.proto
70- RUN protoc -I/api --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --experimental_allow_proto3_optional /api/v1alpha1/state.proto
71- RUN protoc -I/api --go_out=paths=source_relative: /api --go-grpc_out=paths=source_relative:/api --experimental_allow_proto3_optional /api/v1alpha1/runtime.proto
72+ RUN protoc -I/api --go_out=paths=source_relative:/api --go-grpc_out=paths=source_relative:/api --go-vtproto_out=paths=source_relative:/api --go-vtproto_opt=features=marshal+unmarshal+size -- experimental_allow_proto3_optional /api/v1alpha1/resource.proto /api/v1alpha1/state.proto /api/v1alpha1/runtime .proto
73+ RUN goimports -w -local github.com/cosi-project/runtime /api
74+ RUN gofumpt -w /api
7275
7376# runs gofumpt
7477FROM base AS lint-gofumpt
75- RUN find . -name '*.pb.go' | xargs -r rm
76- RUN find . -name '*.pb.gw.go' | xargs -r rm
77- RUN FILES="$(goimports -w -local github.com/cosi-project/runtime . && gofumpt -w .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'gofumports -w -local github.com/cosi-project/runtime .':\n ${FILES}" ; exit 1)
78+ RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'gofumpt -w .':\n ${FILES}" ; exit 1)
79+
80+ # runs goimports
81+ FROM base AS lint-goimports
82+ RUN FILES="$(goimports -l -local github.com/cosi-project/runtime .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/cosi-project/runtime .':\n ${FILES}" ; exit 1)
7883
7984# runs golangci-lint
8085FROM base AS lint-golangci-lint
0 commit comments