Bazel: Automatically fix lint errors with buildifier
In recent buildifier versions, lint errors can be fixed automatically: $ find . \( -name BUILD -o -name "*.bzl" \) -print \ | xargs buildifier --lint=fix This commit was created with Buildifier version 0.19.2: $ buildifier --version buildifier version: 0.19.2 buildifier scm revision: d39e4d5c25111527369142f16cdb49aa67707313 Change-Id: I1f06cd4596e794981ccc2d9fc2d1da9b17f3973a
This commit is contained in:
parent
428f1cc8ae
commit
930f29e2fd
4
BUILD
4
BUILD
@ -1,8 +1,8 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:genrule2.bzl", "genrule2")
|
||||
load("//tools/bzl:pkg_war.bzl", "pkg_war")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
genrule(
|
||||
name = "gen_version",
|
||||
outs = ["version.txt"],
|
||||
|
@ -1,10 +1,8 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:asciidoc.bzl", "documentation_attributes")
|
||||
load("//tools/bzl:asciidoc.bzl", "genasciidoc")
|
||||
load("//tools/bzl:asciidoc.bzl", "genasciidoc_zip")
|
||||
load("//tools/bzl:asciidoc.bzl", "documentation_attributes", "genasciidoc", "genasciidoc_zip")
|
||||
load("//tools/bzl:license.bzl", "license_map")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
exports_files([
|
||||
"replace_macros.py",
|
||||
])
|
||||
|
@ -1,6 +1,4 @@
|
||||
load("//tools/bzl:asciidoc.bzl", "release_notes_attributes")
|
||||
load("//tools/bzl:asciidoc.bzl", "genasciidoc")
|
||||
load("//tools/bzl:asciidoc.bzl", "genasciidoc_zip")
|
||||
load("//tools/bzl:asciidoc.bzl", "genasciidoc", "genasciidoc_zip", "release_notes_attributes")
|
||||
|
||||
SRCS = glob(["*.txt"])
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
load("//tools/bzl:java.bzl", "java_library2")
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
SRCS = glob(["src/test/java/com/google/gerrit/acceptance/*.java"])
|
||||
|
||||
@ -65,8 +66,6 @@ java_library2(
|
||||
],
|
||||
)
|
||||
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
java_doc(
|
||||
name = "acceptance-framework-javadoc",
|
||||
testonly = 1,
|
||||
|
@ -1,3 +1,5 @@
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
|
||||
java_library(
|
||||
name = "elasticsearch",
|
||||
srcs = glob(
|
||||
@ -28,8 +30,6 @@ java_library(
|
||||
],
|
||||
)
|
||||
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
|
||||
java_library(
|
||||
name = "elasticsearch_test_utils",
|
||||
testonly = 1,
|
||||
|
@ -1,6 +1,7 @@
|
||||
load("//lib:guava.bzl", "GUAVA_DOC_URL")
|
||||
load("//lib/jgit:jgit.bzl", "JGIT_DOC_URL")
|
||||
load("//lib:guava.bzl", "GUAVA_DOC_URL")
|
||||
load("//tools/bzl:gwt.bzl", "gwt_module")
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
|
||||
SRC = "src/main/java/com/google/gerrit/extensions/"
|
||||
@ -60,8 +61,6 @@ junit_tests(
|
||||
],
|
||||
)
|
||||
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
java_doc(
|
||||
name = "extension-api-javadoc",
|
||||
external_docs = [
|
||||
|
@ -1,6 +1,6 @@
|
||||
load("//tools/bzl:gwt.bzl", "gwt_module")
|
||||
load("//tools/bzl:java.bzl", "java_library2")
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
load("//tools/bzl:gwt.bzl", "gwt_module")
|
||||
|
||||
EXPORTED_DEPS = [
|
||||
"//gerrit-common:client",
|
||||
|
@ -4,8 +4,8 @@ load(
|
||||
"gwt_genrule",
|
||||
"gwt_user_agent_permutations",
|
||||
)
|
||||
load("//tools/bzl:license.bzl", "license_test")
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
load("//tools/bzl:license.bzl", "license_test")
|
||||
|
||||
gwt_genrule()
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
SRCS = glob(
|
||||
["src/main/java/**/*.java"],
|
||||
)
|
||||
|
@ -1,4 +1,3 @@
|
||||
load("//tools/bzl:java.bzl", "java_library2")
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
load("//tools/bzl:license.bzl", "license_test")
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
SRCS = [
|
||||
"gerrit-server/src/main/java/",
|
||||
"gerrit-httpd/src/main/java/",
|
||||
@ -91,8 +93,6 @@ java_binary(
|
||||
],
|
||||
)
|
||||
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
java_doc(
|
||||
name = "plugin-api-javadoc",
|
||||
libs = PLUGIN_API + [
|
||||
|
@ -1,6 +1,7 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:java.bzl", "java_library2")
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
SRCS = glob(["src/main/java/com/google/gerrit/**/*.java"])
|
||||
|
||||
@ -56,8 +57,6 @@ java_binary(
|
||||
],
|
||||
)
|
||||
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
java_doc(
|
||||
name = "gwtui-api-javadoc",
|
||||
libs = DEPS + [
|
||||
|
@ -1,8 +1,8 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:gwt.bzl", "gwt_module")
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
SRC = "src/main/java/com/google/gerrit/reviewdb/"
|
||||
|
||||
TESTS = "src/test/java/com/google/gerrit/reviewdb/"
|
||||
|
@ -1,3 +1,4 @@
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
load("//tools/bzl:junit.bzl", "junit_tests")
|
||||
|
||||
CONSTANTS_SRC = [
|
||||
@ -241,8 +242,6 @@ junit_tests(
|
||||
],
|
||||
)
|
||||
|
||||
load("//tools/bzl:javadoc.bzl", "java_doc")
|
||||
|
||||
java_doc(
|
||||
name = "doc",
|
||||
libs = [":server"],
|
||||
|
@ -1,5 +1,3 @@
|
||||
load("//tools/bzl:genrule2.bzl", "genrule2")
|
||||
|
||||
# Source Code Pro. Version 2.010 Roman / 1.030 Italics
|
||||
# https://github.com/adobe-fonts/source-code-pro/releases/tag/2.010R-ro%2F1.030R-it
|
||||
filegroup(
|
||||
|
@ -1,4 +1,4 @@
|
||||
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_CENTRAL", "MAVEN_LOCAL", "maven_jar")
|
||||
load("//tools/bzl:maven_jar.bzl", "MAVEN_CENTRAL", "maven_jar")
|
||||
|
||||
_JGIT_VERS = "4.7.6.201810191618-r"
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
load("//lib/js:bower_components.bzl", "define_bower_components")
|
||||
load("//tools/bzl:js.bzl", "js_component")
|
||||
|
||||
load("//tools/bzl:js.bzl", "bower_component", "js_component")
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
# For importing new versions of existing bower packages,
|
||||
#
|
||||
@ -20,8 +21,6 @@ load("//tools/bzl:js.bzl", "bower_component", "js_component")
|
||||
# 4) remove bower_component(name="my_new_dependency", .. ) here
|
||||
#
|
||||
|
||||
load("//lib/js:bower_components.bzl", "define_bower_components")
|
||||
|
||||
define_bower_components()
|
||||
|
||||
js_component(
|
||||
|
@ -1,7 +1,7 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:maven.bzl", "merge_maven_jars")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
# core and backward-codecs both provide
|
||||
# META-INF/services/org.apache.lucene.codecs.Codec, so they must be merged.
|
||||
merge_maven_jars(
|
||||
|
@ -12,10 +12,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
closure_js_library(
|
||||
name = "polymer_closure",
|
||||
srcs = ["@polymer_closure//file"],
|
||||
|
@ -1,7 +1,7 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:js.bzl", "bower_component_bundle")
|
||||
load("//tools/bzl:genrule2.bzl", "genrule2")
|
||||
load("//tools/bzl:js.bzl", "bower_component_bundle")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
bower_component_bundle(
|
||||
name = "polygerrit_components.bower_components",
|
||||
|
@ -1,15 +1,13 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("//tools/bzl:genrule2.bzl", "genrule2")
|
||||
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary", "closure_js_library")
|
||||
load("//tools/bzl:genrule2.bzl", "genrule2")
|
||||
load(
|
||||
"//tools/bzl:js.bzl",
|
||||
"bower_component",
|
||||
"bower_component_bundle",
|
||||
"js_component",
|
||||
"vulcanize",
|
||||
)
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
vulcanize(
|
||||
name = "gr-app",
|
||||
srcs = glob(
|
||||
|
@ -46,7 +46,7 @@ def _replace_macros_impl(ctx):
|
||||
cmd.append("--searchbox")
|
||||
else:
|
||||
cmd.append("--no-searchbox")
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
inputs = [ctx.file._exe, ctx.file.src],
|
||||
outputs = [ctx.outputs.out],
|
||||
command = cmd,
|
||||
@ -114,7 +114,7 @@ def _asciidoc_impl(ctx):
|
||||
".html",
|
||||
]
|
||||
args.extend(_generate_asciidoc_args(ctx))
|
||||
ctx.action(
|
||||
ctx.actions.run(
|
||||
inputs = ctx.files.srcs + [ctx.executable._exe, ctx.file.version],
|
||||
outputs = ctx.outputs.outs,
|
||||
executable = ctx.executable._exe,
|
||||
@ -221,7 +221,7 @@ def _asciidoc_html_zip_impl(ctx):
|
||||
".html",
|
||||
]
|
||||
args.extend(_generate_asciidoc_args(ctx))
|
||||
ctx.action(
|
||||
ctx.actions.run(
|
||||
inputs = ctx.files.srcs + [ctx.executable._exe, ctx.file.version],
|
||||
outputs = [ctx.outputs.out],
|
||||
executable = ctx.executable._exe,
|
||||
@ -279,7 +279,7 @@ def _asciidoc_zip_impl(ctx):
|
||||
"cd %s" % tmpdir,
|
||||
"zip -qr $p/%s *" % ctx.outputs.out.path,
|
||||
])
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
inputs = [ctx.file.src] + ctx.files.resources,
|
||||
outputs = [ctx.outputs.out],
|
||||
command = " && ".join(cmd),
|
||||
|
@ -7,8 +7,8 @@ def _classpath_collector(ctx):
|
||||
elif hasattr(d, "files"):
|
||||
all += d.files
|
||||
|
||||
as_strs = [c.path for c in all]
|
||||
ctx.file_action(
|
||||
as_strs = [c.path for c in all.to_list()]
|
||||
ctx.actions.write(
|
||||
output = ctx.outputs.runtime,
|
||||
content = "\n".join(sorted(as_strs)),
|
||||
)
|
||||
|
@ -117,14 +117,14 @@ def _gwt_user_agent_module(ctx):
|
||||
impl = ALIASES[ua]
|
||||
|
||||
# intermediate artifact: user agent speific GWT xml file
|
||||
gwt_user_agent_xml = ctx.new_file(ctx.label.name + "_gwt.xml")
|
||||
ctx.file_action(
|
||||
gwt_user_agent_xml = ctx.actions.declare_file(ctx.label.name + "_gwt.xml")
|
||||
ctx.actions.write(
|
||||
output = gwt_user_agent_xml,
|
||||
content = USER_AGENT_XML % (MODULE, impl),
|
||||
)
|
||||
|
||||
# intermediate artifact: user agent specific zip with GWT module
|
||||
gwt_user_agent_zip = ctx.new_file(ctx.label.name + "_gwt.zip")
|
||||
gwt_user_agent_zip = ctx.actions.declare_file(ctx.label.name + "_gwt.zip")
|
||||
gwt = "%s_%s.gwt.xml" % (MODULE.replace(".", "/"), ua)
|
||||
dir = gwt_user_agent_zip.path + ".dir"
|
||||
cmd = " && ".join([
|
||||
@ -135,7 +135,7 @@ def _gwt_user_agent_module(ctx):
|
||||
"cp $p/%s %s" % (gwt_user_agent_xml.path, gwt),
|
||||
"$p/%s cC $p/%s $(find . | sed 's|^./||')" % (ctx.executable._zip.path, gwt_user_agent_zip.path),
|
||||
])
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
inputs = [gwt_user_agent_xml] + ctx.files._zip,
|
||||
outputs = [gwt_user_agent_zip],
|
||||
command = cmd,
|
||||
@ -190,7 +190,7 @@ def _gwt_binary_impl(ctx):
|
||||
),
|
||||
])
|
||||
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
inputs = list(deps) + ctx.files._jdk + ctx.files._zip + gwt_user_agent_modules,
|
||||
outputs = [output_zip],
|
||||
mnemonic = "GwtBinary",
|
||||
|
@ -23,7 +23,7 @@ def _impl(ctx):
|
||||
source_jars += l.java.source_jars
|
||||
transitive_jar_set += l.java.transitive_deps
|
||||
|
||||
transitive_jar_paths = [j.path for j in transitive_jar_set]
|
||||
transitive_jar_paths = [j.path for j in transitive_jar_set.to_list()]
|
||||
dir = ctx.outputs.zip.path + ".dir"
|
||||
source = ctx.outputs.zip.path + ".source"
|
||||
external_docs = ["http://docs.oracle.com/javase/8/docs/api"] + ctx.attr.external_docs
|
||||
@ -32,7 +32,7 @@ def _impl(ctx):
|
||||
"export TZ",
|
||||
"rm -rf %s" % source,
|
||||
"mkdir %s" % source,
|
||||
" && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars]),
|
||||
" && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars.to_list()]),
|
||||
"rm -rf %s" % dir,
|
||||
"mkdir %s" % dir,
|
||||
" ".join([
|
||||
@ -55,8 +55,8 @@ def _impl(ctx):
|
||||
"find %s -exec touch -t 198001010000 '{}' ';'" % dir,
|
||||
"(cd %s && zip -Xqr ../%s *)" % (dir, ctx.outputs.zip.basename),
|
||||
]
|
||||
ctx.action(
|
||||
inputs = list(transitive_jar_set) + list(source_jars) + ctx.files._jdk,
|
||||
ctx.actions.run_shell(
|
||||
inputs = transitive_jar_set.to_list() + source_jars.to_list() + ctx.files._jdk,
|
||||
outputs = [zip_output],
|
||||
command = " && ".join(cmd),
|
||||
)
|
||||
|
@ -186,7 +186,7 @@ def _js_component(ctx):
|
||||
"zip -Xqr ../%s *" % ctx.outputs.zip.basename,
|
||||
])
|
||||
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
inputs = ctx.files.srcs,
|
||||
outputs = [ctx.outputs.zip],
|
||||
command = cmd,
|
||||
@ -256,8 +256,8 @@ def _bower_component_bundle_impl(ctx):
|
||||
out_zip = ctx.outputs.zip
|
||||
out_versions = ctx.outputs.version_json
|
||||
|
||||
ctx.action(
|
||||
inputs = list(zips),
|
||||
ctx.actions.run_shell(
|
||||
inputs = zips.to_list(),
|
||||
outputs = [out_zip],
|
||||
command = " && ".join([
|
||||
"p=$PWD",
|
||||
@ -266,7 +266,7 @@ def _bower_component_bundle_impl(ctx):
|
||||
"rm -rf %s.dir" % out_zip.path,
|
||||
"mkdir -p %s.dir/bower_components" % out_zip.path,
|
||||
"cd %s.dir/bower_components" % out_zip.path,
|
||||
"for z in %s; do unzip -q $p/$z ; done" % " ".join(sorted([z.path for z in zips])),
|
||||
"for z in %s; do unzip -q $p/$z ; done" % " ".join(sorted([z.path for z in zips.to_list()])),
|
||||
"cd ..",
|
||||
"find . -exec touch -t 198001010000 '{}' ';'",
|
||||
"zip -Xqr $p/%s bower_components/*" % out_zip.path,
|
||||
@ -274,11 +274,11 @@ def _bower_component_bundle_impl(ctx):
|
||||
mnemonic = "BowerCombine",
|
||||
)
|
||||
|
||||
ctx.action(
|
||||
inputs = list(versions),
|
||||
ctx.actions.run_shell(
|
||||
inputs = versions.to_list(),
|
||||
outputs = [out_versions],
|
||||
mnemonic = "BowerVersions",
|
||||
command = "(echo '{' ; for j in %s ; do cat $j; echo ',' ; done ; echo \\\"\\\":\\\"\\\"; echo '}') > %s" % (" ".join([v.path for v in versions]), out_versions.path),
|
||||
command = "(echo '{' ; for j in %s ; do cat $j; echo ',' ; done ; echo \\\"\\\":\\\"\\\"; echo '}') > %s" % (" ".join([v.path for v in versions.to_list()]), out_versions.path),
|
||||
)
|
||||
|
||||
return struct(
|
||||
@ -351,7 +351,7 @@ def _vulcanize_impl(ctx):
|
||||
use_default_shell_env = True,
|
||||
execution_requirements = {"local": "1"},
|
||||
)
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
mnemonic = "Vulcanize",
|
||||
inputs = [
|
||||
ctx.file._run_npm,
|
||||
@ -376,7 +376,7 @@ def _vulcanize_impl(ctx):
|
||||
ctx.outputs.js.path,
|
||||
])
|
||||
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
mnemonic = "Crisper",
|
||||
inputs = [
|
||||
ctx.file._run_npm,
|
||||
@ -426,4 +426,4 @@ _vulcanize_rule = rule(
|
||||
|
||||
def vulcanize(*args, **kwargs):
|
||||
"""Vulcanize runs vulcanize and crisper on a set of sources."""
|
||||
_vulcanize_rule(*args, pkg = native.package_name(), **kwargs)
|
||||
_vulcanize_rule(pkg = native.package_name(), *args, **kwargs)
|
||||
|
@ -50,7 +50,7 @@ def _impl(ctx):
|
||||
classes = ",".join(
|
||||
[_AsClassName(x) for x in ctx.attr.srcs],
|
||||
)
|
||||
ctx.file_action(output = ctx.outputs.out, content = _OUTPUT % (
|
||||
ctx.actions.write(output = ctx.outputs.out, content = _OUTPUT % (
|
||||
classes,
|
||||
ctx.attr.outname,
|
||||
))
|
||||
|
@ -82,7 +82,7 @@ def _war_impl(ctx):
|
||||
elif hasattr(l, "files"):
|
||||
transitive_lib_deps += l.files
|
||||
|
||||
for dep in transitive_lib_deps:
|
||||
for dep in transitive_lib_deps.to_list():
|
||||
cmd += _add_file(dep, build_output + "/WEB-INF/lib/")
|
||||
inputs.append(dep)
|
||||
|
||||
@ -91,7 +91,7 @@ def _war_impl(ctx):
|
||||
for l in ctx.attr.pgmlibs:
|
||||
transitive_pgmlib_deps += l.java.transitive_runtime_deps
|
||||
|
||||
for dep in transitive_pgmlib_deps:
|
||||
for dep in transitive_pgmlib_deps.to_list():
|
||||
if dep not in inputs:
|
||||
cmd += _add_file(dep, build_output + "/WEB-INF/pgm-lib/")
|
||||
inputs.append(dep)
|
||||
@ -104,14 +104,14 @@ def _war_impl(ctx):
|
||||
transitive_context_deps += jar.java.transitive_runtime_deps
|
||||
elif hasattr(jar, "files"):
|
||||
transitive_context_deps += jar.files
|
||||
for dep in transitive_context_deps:
|
||||
for dep in transitive_context_deps.to_list():
|
||||
cmd += _add_context(dep, build_output)
|
||||
inputs.append(dep)
|
||||
|
||||
# Add zip war
|
||||
cmd.append(_make_war(build_output, war))
|
||||
|
||||
ctx.action(
|
||||
ctx.actions.run_shell(
|
||||
inputs = inputs,
|
||||
outputs = [war],
|
||||
mnemonic = "WAR",
|
||||
|
@ -1,5 +1,5 @@
|
||||
load("//tools/bzl:pkg_war.bzl", "LIBS", "PGMLIBS")
|
||||
load("//tools/bzl:classpath.bzl", "classpath_collector")
|
||||
load("//tools/bzl:pkg_war.bzl", "LIBS", "PGMLIBS")
|
||||
load(
|
||||
"//tools/bzl:plugins.bzl",
|
||||
"CORE_PLUGINS",
|
||||
|
Loading…
x
Reference in New Issue
Block a user