treewide: format repo with buildifier

Change-Id: Ia7aebeb7bba5b119c9157d1ad805cc477bcbb68a
Reviewed-on: https://review.monogon.dev/c/monogon/+/3774
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/osbase/bringup/BUILD.bazel b/osbase/bringup/BUILD.bazel
index 89b40ff..e8e5c75 100644
--- a/osbase/bringup/BUILD.bazel
+++ b/osbase/bringup/BUILD.bazel
@@ -1,5 +1,4 @@
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
-load("//osbase/build:def.bzl", "node_initramfs")
 
 go_library(
     name = "bringup",
diff --git a/osbase/bringup/test/BUILD.bazel b/osbase/bringup/test/BUILD.bazel
index ecb893d..a791a66 100644
--- a/osbase/bringup/test/BUILD.bazel
+++ b/osbase/bringup/test/BUILD.bazel
@@ -22,7 +22,7 @@
     },
     deps = [
         "//osbase/cmd",
-        "@io_bazel_rules_go//go/runfiles:go_default_library",
+        "@io_bazel_rules_go//go/runfiles",
     ],
 )
 
diff --git a/osbase/build/def.bzl b/osbase/build/def.bzl
index 24f2af7..57a7dab 100644
--- a/osbase/build/def.bzl
+++ b/osbase/build/def.bzl
@@ -1,21 +1,4 @@
-#  Copyright 2020 The Monogon Project Authors.
-#
-#  SPDX-License-Identifier: Apache-2.0
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-load("@bazel_skylib//lib:paths.bzl", "paths")
-
-def _build_pure_transition_impl(settings, attr):
+def _build_pure_transition_impl(settings, _attr):
     """
     Transition that enables pure, static build of Go binaries.
     """
@@ -40,7 +23,7 @@
     ],
 )
 
-def _build_static_transition_impl(settings, attr):
+def _build_static_transition_impl(_settings, _attr):
     """
     Transition that enables static builds with CGo and musl for Go binaries.
     """
@@ -116,9 +99,9 @@
 
     for fsspec in ctx.attr.fsspecs:
         if FSSpecInfo in fsspec:
-            fsspecInfo = fsspec[FSSpecInfo]
-            extra_specs.append(fsspecInfo.spec)
-            for f in fsspecInfo.referenced:
+            fsspec_info = fsspec[FSSpecInfo]
+            extra_specs.append(fsspec_info.spec)
+            for f in fsspec_info.referenced:
                 inputs.append(f)
         else:
             # Raw .fsspec prototext. No referenced data allowed.
@@ -254,15 +237,15 @@
         "_mkerofs": attr.label(
             default = Label("//osbase/build/mkerofs"),
             executable = True,
-            cfg = "host",
+            cfg = "exec",
         ),
     },
 )
 
-# VerityConfig is emitted by verity_image, and contains a file enclosing a
+# VerityInfo is emitted by verity_image, and contains a file enclosing a
 # singular dm-verity target table.
-VerityConfig = provider(
-    "Configuration necessary to mount a single dm-verity target.",
+VerityInfo = provider(
+    "Information necessary to mount a single dm-verity target.",
     fields = {
         "table": "A file containing the dm-verity target table. See: https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/verity.html",
     },
@@ -272,7 +255,7 @@
     """
     Create a new file containing the source image data together with the Verity
     metadata appended to it, and provide an associated DeviceMapper Verity target
-    table in a separate file, through VerityConfig provider.
+    table in a separate file, through VerityInfo provider.
     """
 
     # Run mkverity.
@@ -301,7 +284,7 @@
             files = depset([image]),
             runfiles = ctx.runfiles(files = [image]),
         ),
-        VerityConfig(
+        VerityInfo(
             table = table,
         ),
     ]
@@ -311,7 +294,7 @@
     doc = """
       Build a dm-verity target image by appending Verity metadata to the source
       image. A corresponding dm-verity target table will be made available
-      through VerityConfig provider.
+      through VerityInfo provider.
   """,
     attrs = {
         "source": attr.label(
@@ -327,7 +310,7 @@
             default = "//osbase/build/mkverity",
             allow_single_file = True,
             executable = True,
-            cfg = "host",
+            cfg = "exec",
         ),
     },
 )
diff --git a/osbase/build/efi.bzl b/osbase/build/efi.bzl
index 7488650..54b43a6 100644
--- a/osbase/build/efi.bzl
+++ b/osbase/build/efi.bzl
@@ -4,7 +4,7 @@
 """
 
 load("//build/toolchain/llvm-efi:transition.bzl", "build_efi_transition")
-load("//osbase/build:def.bzl", "VerityConfig")
+load("//osbase/build:def.bzl", "VerityInfo")
 
 def _efi_unified_kernel_image_impl(ctx):
     # Find the dependency paths to be passed to mkpayload.
@@ -25,9 +25,9 @@
         )
         deps["cmdline"] = cmdline
 
-    # Get the dm-verity target table from VerityConfig provider.
+    # Get the dm-verity target table from VerityInfo provider.
     if ctx.attr.verity:
-        deps["rootfs_dm_table"] = ctx.attr.verity[VerityConfig].table
+        deps["rootfs_dm_table"] = ctx.attr.verity[VerityInfo].table
 
     # Format deps into command line arguments while keeping track of mkpayload
     # runtime inputs.
@@ -119,7 +119,7 @@
         "verity": attr.label(
             doc = "The DeviceMapper Verity rootfs target table.",
             allow_single_file = True,
-            providers = [DefaultInfo, VerityConfig],
+            providers = [DefaultInfo, VerityInfo],
         ),
         "_mkpayload": attr.label(
             doc = "The mkpayload executable.",
@@ -130,6 +130,6 @@
         ),
     },
     toolchains = [
-        "@bazel_tools//tools/cpp:toolchain_type"
+        "@bazel_tools//tools/cpp:toolchain_type",
     ],
 )
diff --git a/osbase/build/fsspec/BUILD.bazel b/osbase/build/fsspec/BUILD.bazel
index b719522..c3ebdfc 100644
--- a/osbase/build/fsspec/BUILD.bazel
+++ b/osbase/build/fsspec/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 proto_library(
     name = "spec_proto",
diff --git a/osbase/build/genosrelease/defs.bzl b/osbase/build/genosrelease/defs.bzl
index 6fed483..2e7c613 100644
--- a/osbase/build/genosrelease/defs.bzl
+++ b/osbase/build/genosrelease/defs.bzl
@@ -43,7 +43,7 @@
         "stamp_var": attr.string(mandatory = True),
         "_genosrelease": attr.label(
             default = Label("//osbase/build/genosrelease"),
-            cfg = "host",
+            cfg = "exec",
             executable = True,
             allow_files = True,
         ),
diff --git a/osbase/build/mkucode/spec/BUILD.bazel b/osbase/build/mkucode/spec/BUILD.bazel
index 0210a4b..6a01dbc 100644
--- a/osbase/build/mkucode/spec/BUILD.bazel
+++ b/osbase/build/mkucode/spec/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 proto_library(
     name = "mkucode_proto",
diff --git a/osbase/fat32/BUILD.bazel b/osbase/fat32/BUILD.bazel
index e329179..4942844 100644
--- a/osbase/fat32/BUILD.bazel
+++ b/osbase/fat32/BUILD.bazel
@@ -30,7 +30,7 @@
     deps = [
         "@com_github_stretchr_testify//assert",
         "@com_github_stretchr_testify//require",
-        "@io_bazel_rules_go//go/runfiles:go_default_library",
+        "@io_bazel_rules_go//go/runfiles",
         "@org_golang_x_sys//unix",
     ],
 )
diff --git a/osbase/kmod/spec/BUILD.bazel b/osbase/kmod/spec/BUILD.bazel
index 75bcf63..bc58404 100644
--- a/osbase/kmod/spec/BUILD.bazel
+++ b/osbase/kmod/spec/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 proto_library(
     name = "spec_proto",
diff --git a/osbase/logtree/proto/BUILD.bazel b/osbase/logtree/proto/BUILD.bazel
index b049d80..3e47ca5 100644
--- a/osbase/logtree/proto/BUILD.bazel
+++ b/osbase/logtree/proto/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 proto_library(
     name = "proto_proto",
diff --git a/osbase/net/proto/BUILD.bazel b/osbase/net/proto/BUILD.bazel
index cdc115e..c8f4523 100644
--- a/osbase/net/proto/BUILD.bazel
+++ b/osbase/net/proto/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 proto_library(
     name = "net_proto_proto",
diff --git a/osbase/tpm/proto/BUILD.bazel b/osbase/tpm/proto/BUILD.bazel
index 31cfda8..6e5f11d 100644
--- a/osbase/tpm/proto/BUILD.bazel
+++ b/osbase/tpm/proto/BUILD.bazel
@@ -1,6 +1,6 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
 load("@io_bazel_rules_go//go:def.bzl", "go_library")
 load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@rules_proto//proto:defs.bzl", "proto_library")
 
 proto_library(
     name = "proto_proto",