runtime: Format auto-generated client code for cloud-hypervisor API

This patch extends the current process of generating client code for
cloud-hypervisor API with an additional step, `go-fmt`, which will remove
the generated `client/go.mod` file and format all auto-generated code.

Fixes: #1606

Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
Bo Chen 2021-03-31 14:30:29 -07:00
parent c0c7bef2b8
commit 52cacf8838

View File

@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
all: | update-yaml generate-client-code all: | update-yaml generate-client-code go-fmt
MK_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) MK_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
YQ_INSTALLER := "$(MK_DIR)/../../../../../ci/install_yq.sh" YQ_INSTALLER := "$(MK_DIR)/../../../../../ci/install_yq.sh"
VERSIONS_FILE := "$(MK_DIR)/../../../../../versions.yaml" VERSIONS_FILE := "$(MK_DIR)/../../../../../versions.yaml"
@ -17,8 +17,9 @@ generate-client-code: clean-generated-code
-i /local/cloud-hypervisor.yaml \ -i /local/cloud-hypervisor.yaml \
-g go \ -g go \
-o /local/client -o /local/client
go-fmt:
rm client/go.mod; \
go fmt ./...
update-yaml: update-yaml:
ifndef YQ ifndef YQ