From e5203c0f5d51cb263f6edc23b8b1722dcde0bd4e Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Tue, 12 Jun 2018 13:09:57 -0400 Subject: Reformat .bzl files with buildifier and add format check. Buildifier 0.12.0 includes initial support for reformatting .bzl files. - Reformat all the bzl files. - Expand the travis check to check the .bzl files also. --- skylark_library.bzl | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'skylark_library.bzl') diff --git a/skylark_library.bzl b/skylark_library.bzl index 5791b00..a91639d 100644 --- a/skylark_library.bzl +++ b/skylark_library.bzl @@ -15,46 +15,46 @@ """Skylib module containing a library rule for aggregating rules files.""" SkylarkLibraryInfo = provider( - 'Information on contained Skylark rules.', - fields={ - 'srcs': 'Top level rules files.', - 'transitive_srcs': 'Transitive closure of rules files required for ' + - 'interpretation of the srcs', + "Information on contained Skylark rules.", + fields = { + "srcs": "Top level rules files.", + "transitive_srcs": "Transitive closure of rules files required for " + + "interpretation of the srcs", }, ) def _skylark_library_impl(ctx): - deps_files = [depset(x.files, order="postorder") for x in ctx.attr.deps] - all_files = depset(ctx.files.srcs, order="postorder", transitive=deps_files) - return [ - # All dependent files should be listed in both `files` and in `runfiles`; - # this ensures that a `skylark_library` can be referenced as `data` from - # a separate program, or from `tools` of a genrule(). - DefaultInfo( - files=all_files, - runfiles=ctx.runfiles(files=list(all_files)), - ), + deps_files = [depset(x.files, order = "postorder") for x in ctx.attr.deps] + all_files = depset(ctx.files.srcs, order = "postorder", transitive = deps_files) + return [ + # All dependent files should be listed in both `files` and in `runfiles`; + # this ensures that a `skylark_library` can be referenced as `data` from + # a separate program, or from `tools` of a genrule(). + DefaultInfo( + files = all_files, + runfiles = ctx.runfiles(files = list(all_files)), + ), - # We also define our own provider struct, for aggregation and testing. - SkylarkLibraryInfo( - srcs=ctx.files.srcs, - transitive_srcs=all_files, - ), - ] + # We also define our own provider struct, for aggregation and testing. + SkylarkLibraryInfo( + srcs = ctx.files.srcs, + transitive_srcs = all_files, + ), + ] skylark_library = rule( - implementation=_skylark_library_impl, - attrs={ + implementation = _skylark_library_impl, + attrs = { "srcs": attr.label_list( - allow_files=[".bzl"], + allow_files = [".bzl"], ), "deps": attr.label_list( - allow_files=[".bzl"], - providers=[ + allow_files = [".bzl"], + providers = [ [SkylarkLibraryInfo], ], - ) - } + ), + }, ) """Creates a logical collection of Skylark .bzl files. -- cgit v1.2.3