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/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",