blob: a3f5555c89ac76c398fac6d37d4fb2efcccd3ca1 [file] [log] [blame] [edit]
"""BUILD definition for the formatter binary
This is in its own package because it has so many loading-time symbols,
we don't want to trigger eager fetches of these for builds that don't want to run format.
"""
load("@aspect_rules_lint//format:defs.bzl", "multi_formatter_binary")
package(default_visibility = ["//:__subpackages__"])
alias(
name = "shfmt",
actual = select({
"@bazel_tools//src/conditions:darwin_arm64": "@shfmt_darwin_aarch64//file:shfmt",
"@bazel_tools//src/conditions:darwin_x86_64": "@shfmt_darwin_x86_64//file:shfmt",
"@bazel_tools//src/conditions:linux_aarch64": "@shfmt_linux_aarch64//file:shfmt",
"@bazel_tools//src/conditions:linux_x86_64": "@shfmt_linux_x86_64//file:shfmt",
"//conditions:default": ":noop",
}),
)
multi_formatter_binary(
name = "format",
sh = ":shfmt",
starlark = "@buildifier_prebuilt//:buildifier",
)