mirror of https://github.com/kubernetes/kops.git
Replace bazel :gofmt target with direct invocation
The rule to run from the workspace is broken by the .bazel-bin change, but bazel now supports direct invocation.
This commit is contained in:
parent
05ae9aa5b4
commit
b43afba89a
|
@ -23,10 +23,3 @@ go_library(
|
|||
],
|
||||
importpath = "k8s.io/kops",
|
||||
)
|
||||
|
||||
load("@io_k8s_repo_infra//defs:run_in_workspace.bzl", "workspace_binary")
|
||||
|
||||
workspace_binary(
|
||||
name = "gofmt",
|
||||
cmd = "@go_sdk//:bin/gofmt",
|
||||
)
|
||||
|
|
2
Makefile
2
Makefile
|
@ -360,7 +360,7 @@ gomod: bazelisk gomod-prereqs
|
|||
|
||||
.PHONY: gofmt
|
||||
gofmt:
|
||||
find $(KOPS_ROOT) -name "*.go" | grep -v vendor | xargs ${BAZEL} run //:gofmt -- -w -s
|
||||
find $(KOPS_ROOT) -name "*.go" | grep -v vendor | xargs ${BAZEL} run @go_sdk//:bin/gofmt -- -w -s
|
||||
|
||||
.PHONY: goimports
|
||||
goimports:
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
cd "${KOPS_ROOT}" || exit 1
|
||||
|
||||
bad_files=$(git ls-files "*.go" | grep -v vendor | xargs bazelisk run //:gofmt -- -s -w -l)
|
||||
bad_files=$(git ls-files "*.go" | grep -v vendor | xargs bazelisk run @go_sdk//:bin/gofmt -- -s -w -l)
|
||||
if [[ -n "${bad_files}" ]]; then
|
||||
echo "FAIL: 'make gofmt' needs to be run on the following files: "
|
||||
echo "${bad_files}"
|
||||
|
|
Loading…
Reference in New Issue