Import buildifier
This patch sets up buildifier to run as part of CI. It can also be run
manually via `//tools/lint:buildifier`.
As a consequence, I needed to make the whole repo conform.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Ic41c97b17255813b6c21aef40ab2f8a216683a2c
diff --git a/tools/go/BUILD b/tools/go/BUILD
index 1895ffe..25b3adb 100644
--- a/tools/go/BUILD
+++ b/tools/go/BUILD
@@ -1,3 +1,6 @@
+load("@bazel_skylib//rules:write_file.bzl", "write_file")
+load("@io_bazel_rules_go//go:def.bzl", "go_sdk", "go_toolchain")
+
py_library(
name = "mirror_lib",
srcs = [
@@ -22,10 +25,13 @@
"mirror_go_repos.py",
],
data = [
+ "@com_github_bazelbuild_buildtools//buildifier",
"@go_sdk//:bin/go",
],
+ target_compatible_with = ["@platforms//cpu:x86_64"],
deps = [
":mirror_lib",
+ "@bazel_tools//tools/python/runfiles",
],
)
@@ -36,9 +42,6 @@
# For platforms that do support Go, we use go_register_toolchain() in
# WORKSPACE.
-load("@bazel_skylib//rules:write_file.bzl", "write_file")
-load("@io_bazel_rules_go//go:def.bzl", "go_sdk", "go_toolchain")
-
write_file(
name = "noop_error_exit",
out = "noop_error_exit.sh",