Skip to content

Commit

Permalink
Move buildifier setup from WORKSPACE to Bzlmod
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Adams <[email protected]>
  • Loading branch information
saraadams committed Dec 4, 2023
1 parent 1328f52 commit 921271e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 68 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# =========================================

bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "buildifier_prebuilt", version = "6.3.3")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
Expand Down
54 changes: 0 additions & 54 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,3 @@ workspace(
name = "com_engflow_bazel_invocation_analyzer",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

# Dependencies required for linting

## BUILD files
http_file(
name = "buildifier_darwin_amd64",
executable = True,
sha256 = "c9378d9f4293fc38ec54a08fbc74e7a9d28914dae6891334401e59f38f6e65dc",
urls = [
"https://storage.googleapis.com/engflow-tools-public/github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-darwin-amd64",
"https://github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-darwin-amd64",
],
)

http_file(
name = "buildifier_darwin_arm64",
executable = True,
sha256 = "745feb5ea96cb6ff39a76b2821c57591fd70b528325562486d47b5d08900e2e4",
urls = [
"https://storage.googleapis.com/engflow-tools-public/github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-darwin-arm64",
"https://github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-darwin-arm64",
],
)

http_file(
name = "buildifier_linux_amd64",
executable = True,
sha256 = "52bf6b102cb4f88464e197caac06d69793fa2b05f5ad50a7e7bf6fbd656648a3",
urls = [
"https://storage.googleapis.com/engflow-tools-public/github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-linux-amd64",
"https://github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-linux-amd64",
],
)

http_file(
name = "buildifier_linux_arm64",
executable = True,
sha256 = "917d599dbb040e63ae7a7e1adb710d2057811902fdc9e35cce925ebfd966eeb8",
urls = [
"https://storage.googleapis.com/engflow-tools-public/github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-linux-arm64",
"https://github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-linux-arm64",
],
)

http_file(
name = "buildifier_windows_amd64",
executable = True,
sha256 = "2f039125e2fbef4c804e43dc11c71866cf444306ac6d0f5e38c592854458f425",
urls = [
"https://storage.googleapis.com/engflow-tools-public/github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-windows-amd64.exe",
"https://github.com/bazelbuild/buildtools/releases/download/5.1.0/buildifier-windows-amd64.exe",
],
)
2 changes: 1 addition & 1 deletion infra/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ EOT
}

JAVA_FORMATTER="$(rlocation com_engflow_bazel_invocation_analyzer/third_party/google-java-format/google-java-format)"
STARLARK_FORMATTER="$(rlocation com_engflow_bazel_invocation_analyzer/third_party/buildifier/buildifier.exe)"
STARLARK_FORMATTER="$(rlocation com_engflow_bazel_invocation_analyzer/third_party/buildifier/buildifier)"
POSITIONAL_ARGS=()
FIX=

Expand Down
16 changes: 3 additions & 13 deletions third_party/buildifier/BUILD
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
package(default_visibility = ["//infra:__subpackages__"])

load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@buildifier_prebuilt//:rules.bzl", "buildifier_binary")

copy_file(
buildifier_binary(
name = "buildifier",
src = select({
"//conditions:darwin_arm64": "@buildifier_darwin_arm64//file",
"//conditions:darwin_x86_64": "@buildifier_darwin_amd64//file",
"//conditions:linux_aarch64": "@buildifier_linux_arm64//file",
"//conditions:linux_x86_64": "@buildifier_linux_amd64//file",
"//conditions:windows": "@buildifier_windows_amd64//file",
"//conditions:default": "@buildifier_linux_amd64//file",
}),
out = "buildifier.exe",
allow_symlink = True,
is_executable = True,
visibility = ["//visibility:public"],
)

0 comments on commit 921271e

Please sign in to comment.