diff options
author | vladmos <vladmos@google.com> | 2018-06-01 04:51:21 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-01 04:52:44 -0700 |
commit | 20a042faa91acf8db78684de9f38c4e628d61dd6 (patch) | |
tree | c2fc5c6d30cb51cb3f6e30ed0fb2d25f5525585f /distdir.bzl | |
parent | 2269ee2af91b7df13820381d61e8e4e26a257b3a (diff) |
Format all bzl files with buildifier
This CL aslo enables a presubmit check for correct formatting of all bzl files in //third_party/bazel.
PiperOrigin-RevId: 198857055
Diffstat (limited to 'distdir.bzl')
-rw-r--r-- | distdir.bzl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/distdir.bzl b/distdir.bzl index f5a130de27..fb237d7e85 100644 --- a/distdir.bzl +++ b/distdir.bzl @@ -13,7 +13,7 @@ # limitations under the License. """Defines a repository rule that generates an archive consisting of the specified files to fetch""" -_BUILD=""" +_BUILD = """ load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") pkg_tar( @@ -26,20 +26,21 @@ pkg_tar( """ def _distdir_tar_impl(ctx): - for name in ctx.attr.archives: - ctx.download(ctx.attr.urls[name], name, ctx.attr.sha256[name], False) - ctx.file("WORKSPACE", "") - ctx.file("BUILD", - _BUILD.format(srcs=ctx.attr.archives, dirname=ctx.attr.dirname)) + for name in ctx.attr.archives: + ctx.download(ctx.attr.urls[name], name, ctx.attr.sha256[name], False) + ctx.file("WORKSPACE", "") + ctx.file( + "BUILD", + _BUILD.format(srcs = ctx.attr.archives, dirname = ctx.attr.dirname), + ) _distdir_tar_attrs = { - "archives" : attr.string_list(), - "sha256" : attr.string_dict(), - "urls" : attr.string_list_dict(), - "dirname" : attr.string(default="distdir"), + "archives": attr.string_list(), + "sha256": attr.string_dict(), + "urls": attr.string_list_dict(), + "dirname": attr.string(default = "distdir"), } - distdir_tar = repository_rule( implementation = _distdir_tar_impl, attrs = _distdir_tar_attrs, |