Skip to content

Commit e218e6e

Browse files
committed
Use buildifier from nixpkgs
This avoids building the tool from scratch, if we can fetch it from the cache.
1 parent ac75407 commit e218e6e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ exports_files(["defs.bzl"])
44

55
buildifier(
66
name = "buildifier-diff",
7+
buildifier = "@buildifier//:buildifier",
78
diff_command = "diff -u",
89
mode = "diff",
910
)
1011

1112
buildifier(
1213
name = "buildifier",
14+
buildifier = "@buildifier//:buildifier",
1315
lint_mode = "warn",
1416
)

WORKSPACE

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,14 @@ gazelle_dependencies()
204204
# Buildifier preamble
205205
#######################
206206

207-
http_archive(
208-
name = "com_github_bazelbuild_buildtools",
209-
sha256 = "53119397bbce1cd7e4c590e117dcda343c2086199de62932106c80733526c261",
210-
strip_prefix = "buildtools-8.2.1",
211-
url = "https://github.com/bazelbuild/buildtools/archive/refs/tags/v8.2.1.tar.gz",
207+
nixpkgs_package(
208+
name = "buildifier",
209+
attribute_path = "buildifier",
210+
build_file_content = """\
211+
filegroup(
212+
name = "buildifier",
213+
srcs = ["bin/buildifier"],
214+
visibility = ["//visibility:public"]
215+
)""",
216+
repository = "@nixpkgs",
212217
)

0 commit comments

Comments
 (0)