Skip to content

Commit edfbeed

Browse files
committed
Run buildifier over bzl files
1 parent bee5ee2 commit edfbeed

21 files changed

+168
-159
lines changed

dotnet/merge-assemblies.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _merged_assembly_impl(ctx):
2929
executable = ctx.executable.merge_tool,
3030
arguments = args,
3131
inputs = ctx.attr.src_assembly.files,
32-
outputs = [ctx.outputs.out]
32+
outputs = [ctx.outputs.out],
3333
)
3434

3535
runfiles = ctx.runfiles(
@@ -57,7 +57,7 @@ merged_assembly = rule(
5757
executable = True,
5858
cfg = "host",
5959
default = Label("//third_party/dotnet/ilmerge:ilmerge.exe"),
60-
allow_single_file = True
60+
allow_single_file = True,
6161
),
6262
},
6363
toolchains = ["//third_party/dotnet/ilmerge:toolchain_type"],

dotnet/nuget.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _nuget_package_impl(ctx):
1414
# "<base>/net46", etc.). The base path for creating the NuGet
1515
# package should be the "<base>" directory, which we need to
1616
# hard-code with the parent operator, because Bazel doesn't
17-
# provide proper path traversal for custom rules.
17+
# provide proper path traversal for custom rules.
1818
base_path = ctx.files.deps[0].dirname + "/.."
1919

2020
args.append(ctx.expand_location(ctx.attr.src.files.to_list()[0].path))
@@ -33,7 +33,7 @@ def _nuget_package_impl(ctx):
3333
inputs = ctx.attr.src.files.to_list() + ctx.files.deps,
3434
outputs = [
3535
package_file,
36-
]
36+
],
3737
)
3838

3939
return DefaultInfo(files = depset([
@@ -44,7 +44,7 @@ nuget_package = rule(
4444
implementation = _nuget_package_impl,
4545
attrs = {
4646
"src": attr.label(
47-
allow_single_file = True
47+
allow_single_file = True,
4848
),
4949
"deps": attr.label_list(),
5050
"package_id": attr.string(),
@@ -53,7 +53,7 @@ nuget_package = rule(
5353
executable = True,
5454
cfg = "host",
5555
default = Label("//third_party/dotnet/nuget:nuget.exe"),
56-
allow_single_file = True
56+
allow_single_file = True,
5757
),
58-
}
58+
},
5959
)

dotnet/nunit-test.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _nunit_test_impl(ctx):
8888
additional_args = "%*"
8989
result_location = "%XML_OUTPUT_FILE%"
9090
script_prefix = "@echo off"
91-
91+
9292
script_file_name = "{}.{}".format(name, script_file_extension)
9393
script_file = ctx.actions.declare_file(script_file_name)
9494
script_content = TEST_RUNNER_SCRIPT_CONTENT.format(
@@ -133,7 +133,7 @@ nunit_test = rule(
133133
"dotnet_context_data": attr.label(default = Label("@io_bazel_rules_dotnet//:dotnet_context_data")),
134134
"test_runner": attr.label(
135135
default = Label("//third_party/dotnet/nunit.console-3.10.0/bin/net35:nunitconsole"),
136-
allow_files = True
136+
allow_files = True,
137137
),
138138
"_copy": attr.label(default = Label("@io_bazel_rules_dotnet//dotnet/tools/copy")),
139139
"_xslt": attr.label(default = Label("@io_bazel_rules_dotnet//tools/converttests:n3.xslt"), allow_files = True),

dotnet/workspace.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
load("@d2l_rules_csharp//csharp:defs.bzl",
1+
load(
2+
"@d2l_rules_csharp//csharp:defs.bzl",
23
"csharp_register_toolchains",
34
"csharp_repositories",
4-
"import_nuget_package")
5+
"import_nuget_package",
6+
)
57

68
def selenium_register_dotnet():
79
csharp_register_toolchains()

java/defs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("//java/private:dist_zip.bzl", _java_dist_zip = "java_dist_zip")
22
load("//java/private:export.bzl", _java_export = "java_export")
3-
load("//java/private:test.bzl", _java_test_suite = "java_test_suite", _java_selenium_test_suite = "java_selenium_test_suite")
3+
load("//java/private:test.bzl", _java_selenium_test_suite = "java_selenium_test_suite", _java_test_suite = "java_test_suite")
44

55
java_dist_zip = _java_dist_zip
66
java_export = _java_export

java/private/dist_zip.bzl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,21 @@ def _java_dist_zip_impl(ctx):
116116

117117
for info in infos:
118118
for dist_info in info.dist_infos.to_list():
119-
if not dist_info.binary_jar:
120-
continue
121-
122-
inputs.append(dist_info.binary_jar)
123-
if is_third_party(ctx.attr.third_party_prefixes, dist_info.target):
124-
third_party.append("lib/%s.jar=%s" % (dist_info.base_name, dist_info.binary_jar.path))
125-
else:
126-
first_party.append("%s.jar=%s" % (dist_info.base_name, dist_info.binary_jar.path))
127-
128-
if dist_info.source_jar:
129-
inputs.append(dist_info.source_jar)
130-
if is_third_party(ctx.attr.third_party_prefixes, dist_info.target):
131-
third_party.append("lib/%s-sources.jar=%s" % (dist_info.base_name, dist_info.source_jar.path))
132-
else:
133-
first_party.append("%s-sources.jar=%s" % (dist_info.base_name, dist_info.source_jar.path))
119+
if not dist_info.binary_jar:
120+
continue
121+
122+
inputs.append(dist_info.binary_jar)
123+
if is_third_party(ctx.attr.third_party_prefixes, dist_info.target):
124+
third_party.append("lib/%s.jar=%s" % (dist_info.base_name, dist_info.binary_jar.path))
125+
else:
126+
first_party.append("%s.jar=%s" % (dist_info.base_name, dist_info.binary_jar.path))
127+
128+
if dist_info.source_jar:
129+
inputs.append(dist_info.source_jar)
130+
if is_third_party(ctx.attr.third_party_prefixes, dist_info.target):
131+
third_party.append("lib/%s-sources.jar=%s" % (dist_info.base_name, dist_info.source_jar.path))
132+
else:
133+
first_party.append("%s-sources.jar=%s" % (dist_info.base_name, dist_info.source_jar.path))
134134

135135
args.add_all(sorted(files))
136136
args.add_all(sorted(first_party))

java/private/export.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def java_export(
99
pom_template,
1010
module_uses_services = [],
1111
module_exclude_patterns = [
12-
".*\\.internal.*",
12+
".*\\.internal.*",
1313
],
1414
visibility = None,
1515
**kwargs):
@@ -18,7 +18,8 @@ def java_export(
1818
# Construct the java library, or something that looks like one
1919
native.java_library(
2020
name = "%s-base-lib" % name,
21-
**kwargs)
21+
**kwargs
22+
)
2223

2324
# Build the maven artifacts. The output of this has the same JavaInfo as
2425
# the lib, but also has maven coordinates added.

java/private/maven_artifacts.bzl

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ def _maven_artifacts_impl(ctx):
1111
src_jar = ctx.outputs.srcjar
1212
combine_jars(ctx, ctx.executable._singlejar, info.source_jars.to_list(), src_jar)
1313

14-
# # Now generate the module info
15-
# module_jar = ctx.actions.declare_file("%s-module.jar" % ctx.attr.name)
16-
#
17-
# args = ctx.actions.args()
18-
# args.add_all(["--coordinates", ctx.attr.maven_coordinates])
19-
# args.add_all(["--in", temp_bin_jar.path])
20-
# args.add_all(["--out", module_jar.path])
21-
# if len(ctx.attr.module_uses_services) > 0:
22-
# args.add_all(ctx.attr.module_uses_services, before_each = "--uses")
23-
#
24-
# paths = [file.path for file in target[GatheredJavaModuleInfo].module_jars.to_list()]
25-
# if len(paths) > 0:
26-
# args.add_all(["--module-path", ctx.host_configuration.host_path_separator.join(paths)])
27-
# if len(ctx.attr.module_exclude_patterns) > 0:
28-
# args.add_all(ctx.attr.module_exclude_patterns, before_each = "--exclude")
29-
#
30-
# ctx.actions.run(
31-
# mnemonic = "BuildModuleJar",
32-
# inputs = [temp_bin_jar] + target[GatheredJavaModuleInfo].module_jars.to_list(),
33-
# outputs = [module_jar],
34-
# executable = ctx.executable._generate_module,
35-
# arguments = [args],
36-
# )
37-
#
38-
# # Now merge the module info and the binary jars
39-
# combine_jars(ctx, ctx.executable._singlejar, [temp_bin_jar, module_jar], ctx.outputs.binjar)
14+
# # Now generate the module info
15+
# module_jar = ctx.actions.declare_file("%s-module.jar" % ctx.attr.name)
16+
#
17+
# args = ctx.actions.args()
18+
# args.add_all(["--coordinates", ctx.attr.maven_coordinates])
19+
# args.add_all(["--in", temp_bin_jar.path])
20+
# args.add_all(["--out", module_jar.path])
21+
# if len(ctx.attr.module_uses_services) > 0:
22+
# args.add_all(ctx.attr.module_uses_services, before_each = "--uses")
23+
#
24+
# paths = [file.path for file in target[GatheredJavaModuleInfo].module_jars.to_list()]
25+
# if len(paths) > 0:
26+
# args.add_all(["--module-path", ctx.host_configuration.host_path_separator.join(paths)])
27+
# if len(ctx.attr.module_exclude_patterns) > 0:
28+
# args.add_all(ctx.attr.module_exclude_patterns, before_each = "--exclude")
29+
#
30+
# ctx.actions.run(
31+
# mnemonic = "BuildModuleJar",
32+
# inputs = [temp_bin_jar] + target[GatheredJavaModuleInfo].module_jars.to_list(),
33+
# outputs = [module_jar],
34+
# executable = ctx.executable._generate_module,
35+
# arguments = [args],
36+
# )
37+
#
38+
# # Now merge the module info and the binary jars
39+
# combine_jars(ctx, ctx.executable._singlejar, [temp_bin_jar, module_jar], ctx.outputs.binjar)
4040

4141
defaultInfo = target[DefaultInfo]
4242

java/private/module.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def _has_java_module_deps(target, ctx):
2323
# Gather all transitive deps
2424
gathered = []
2525
for dep in all_deps:
26-
if GatheredJavaModuleInfo in dep:
27-
items = dep[GatheredJavaModuleInfo].module_jars.to_list()
28-
gathered.extend(items)
26+
if GatheredJavaModuleInfo in dep:
27+
items = dep[GatheredJavaModuleInfo].module_jars.to_list()
28+
gathered.extend(items)
2929
transitive = depset(gathered)
3030

3131
if JavaModuleInfo in target:
@@ -52,7 +52,7 @@ def _has_java_module_deps(target, ctx):
5252
else:
5353
return [GatheredJavaModuleInfo(
5454
binary_jars = depset([]),
55-
module_jars = depset([], transitive = [transitive])
55+
module_jars = depset([], transitive = [transitive]),
5656
)]
5757

5858
has_java_module_deps = aspect(

java/private/test.bzl

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("@bazel_tools//tools/jdk:toolchain_utils.bzl", "find_java_runtime_toolchain
33
_BROWSERS = {
44
"chrome": {
55
"jvm_flags": ["-Dselenium.browser=chrome"],
6-
"tags": []
6+
"tags": [],
77
},
88
"edge": {
99
"jvm_flags": ["-Dselenium.browser=edge"],
@@ -205,48 +205,48 @@ def java_selenium_test_suite(
205205
suites.append(test_name)
206206
native.test_suite(name = name, tests = suites, tags = tags + ["manual"])
207207

208-
209208
def java_test_suite(
210-
name,
211-
srcs,
212-
size = None,
213-
tags = [],
214-
visibility = None,
215-
**kwargs):
216-
217-
# By default bazel computes the name of test classes based on the
218-
# standard Maven directory structure, which we don't use in
219-
# Selenium, so try to compute the correct package name.
220-
pkg = _package_name()
221-
222-
tests = []
223-
224-
actual_tags = []
225-
actual_tags.extend(tags)
226-
if "small" != size:
227-
actual_tags.append("no-sandbox")
228-
229-
for src in srcs:
230-
if src.endswith('Test.java'):
231-
test_name = src[:-len('.java')]
232-
233-
test_class = _test_class_name(src)
234-
235-
if test_name in native.existing_rules():
236-
test_name = "%s-%s" % (name, test_name)
237-
tests += [test_name]
238-
239-
native.java_test(
240-
name = test_name,
241-
srcs = [src],
242-
size = size,
243-
test_class = test_class,
244-
tags = actual_tags,
245-
visibility = ["//visibility:private"],
246-
**kwargs)
247-
248-
native.test_suite(
249-
name = name,
250-
tests = tests,
251-
tags = ["manual"] + tags,
252-
visibility = visibility)
209+
name,
210+
srcs,
211+
size = None,
212+
tags = [],
213+
visibility = None,
214+
**kwargs):
215+
# By default bazel computes the name of test classes based on the
216+
# standard Maven directory structure, which we don't use in
217+
# Selenium, so try to compute the correct package name.
218+
pkg = _package_name()
219+
220+
tests = []
221+
222+
actual_tags = []
223+
actual_tags.extend(tags)
224+
if "small" != size:
225+
actual_tags.append("no-sandbox")
226+
227+
for src in srcs:
228+
if src.endswith("Test.java"):
229+
test_name = src[:-len(".java")]
230+
231+
test_class = _test_class_name(src)
232+
233+
if test_name in native.existing_rules():
234+
test_name = "%s-%s" % (name, test_name)
235+
tests += [test_name]
236+
237+
native.java_test(
238+
name = test_name,
239+
srcs = [src],
240+
size = size,
241+
test_class = test_class,
242+
tags = actual_tags,
243+
visibility = ["//visibility:private"],
244+
**kwargs
245+
)
246+
247+
native.test_suite(
248+
name = name,
249+
tests = tests,
250+
tags = ["manual"] + tags,
251+
visibility = visibility,
252+
)

0 commit comments

Comments
 (0)