Bazel: Automatically fix lint errors with buildifier 0.20.0
$ buildifier --version buildifier version: 0.20.0 buildifier scm revision: db073457c5a56d810e46efc18bb93a4fd7aa7b5e Change-Id: Ia14bf16aa6e61ea58645a379da2a871ca3d40d0d
This commit is contained in:
parent
930f29e2fd
commit
88d0885a57
@ -62,11 +62,11 @@ def jgit_maven_repos():
|
||||
|
||||
def jgit_dep(name):
|
||||
mapping = {
|
||||
"@jgit-junit//jar": "@jgit//org.eclipse.jgit.junit:junit",
|
||||
"@jgit-lib//jar:src": "@jgit//org.eclipse.jgit:libjgit-src.jar",
|
||||
"@jgit-lib//jar": "@jgit//org.eclipse.jgit:jgit",
|
||||
"@jgit-servlet//jar": "@jgit//org.eclipse.jgit.http.server:jgit-servlet",
|
||||
"@jgit-archive//jar": "@jgit//org.eclipse.jgit.archive:jgit-archive",
|
||||
"@jgit-junit//jar": "@jgit//org.eclipse.jgit.junit:junit",
|
||||
"@jgit-lib//jar": "@jgit//org.eclipse.jgit:jgit",
|
||||
"@jgit-lib//jar:src": "@jgit//org.eclipse.jgit:libjgit-src.jar",
|
||||
"@jgit-servlet//jar": "@jgit//org.eclipse.jgit.http.server:jgit-servlet",
|
||||
}
|
||||
|
||||
if LOCAL_JGIT_REPO:
|
||||
|
@ -56,17 +56,17 @@ def _replace_macros_impl(ctx):
|
||||
|
||||
_replace_macros = rule(
|
||||
attrs = {
|
||||
"_exe": attr.label(
|
||||
default = Label("//Documentation:replace_macros.py"),
|
||||
allow_single_file = True,
|
||||
),
|
||||
"src": attr.label(
|
||||
mandatory = True,
|
||||
allow_single_file = [".txt"],
|
||||
),
|
||||
"suffix": attr.string(mandatory = True),
|
||||
"searchbox": attr.bool(default = True),
|
||||
"out": attr.output(mandatory = True),
|
||||
"searchbox": attr.bool(default = True),
|
||||
"suffix": attr.string(mandatory = True),
|
||||
"_exe": attr.label(
|
||||
default = Label("//Documentation:replace_macros.py"),
|
||||
allow_single_file = True,
|
||||
),
|
||||
},
|
||||
implementation = _replace_macros_impl,
|
||||
)
|
||||
@ -123,23 +123,23 @@ def _asciidoc_impl(ctx):
|
||||
)
|
||||
|
||||
_asciidoc_attrs = {
|
||||
"srcs": attr.label_list(
|
||||
mandatory = True,
|
||||
allow_files = True,
|
||||
),
|
||||
"attributes": attr.string_list(),
|
||||
"backend": attr.string(),
|
||||
"suffix": attr.string(mandatory = True),
|
||||
"version": attr.label(
|
||||
default = Label("//:version.txt"),
|
||||
allow_single_file = True,
|
||||
),
|
||||
"_exe": attr.label(
|
||||
default = Label("//lib/asciidoctor:asciidoc"),
|
||||
cfg = "host",
|
||||
allow_files = True,
|
||||
executable = True,
|
||||
),
|
||||
"srcs": attr.label_list(
|
||||
mandatory = True,
|
||||
allow_files = True,
|
||||
),
|
||||
"version": attr.label(
|
||||
default = Label("//:version.txt"),
|
||||
allow_single_file = True,
|
||||
),
|
||||
"suffix": attr.string(mandatory = True),
|
||||
"backend": attr.string(),
|
||||
"attributes": attr.string_list(),
|
||||
}
|
||||
|
||||
_asciidoc = rule(
|
||||
@ -293,11 +293,11 @@ _asciidoc_zip = rule(
|
||||
mandatory = True,
|
||||
allow_single_file = [".zip"],
|
||||
),
|
||||
"directory": attr.string(mandatory = True),
|
||||
"resources": attr.label_list(
|
||||
mandatory = True,
|
||||
allow_files = True,
|
||||
),
|
||||
"directory": attr.string(mandatory = True),
|
||||
},
|
||||
outputs = {
|
||||
"out": "%{name}.zip",
|
||||
|
@ -33,9 +33,9 @@ BROWSERS = [
|
||||
|
||||
ALIASES = {
|
||||
"chrome": "safari",
|
||||
"edge": "gecko1_8",
|
||||
"firefox": "gecko1_8",
|
||||
"msie": "ie10",
|
||||
"edge": "gecko1_8",
|
||||
}
|
||||
|
||||
MODULE = "com.google.gerrit.GerritGwtUI"
|
||||
@ -213,14 +213,14 @@ def _get_transitive_closure(ctx):
|
||||
|
||||
gwt_binary = rule(
|
||||
attrs = {
|
||||
"user_agent": attr.string(),
|
||||
"style": attr.string(default = "OBF"),
|
||||
"optimize": attr.string(default = "9"),
|
||||
"deps": attr.label_list(allow_files = jar_filetype),
|
||||
"module": attr.string_list(default = [MODULE]),
|
||||
"module_deps": attr.label_list(allow_files = jar_filetype),
|
||||
"compiler_args": attr.string_list(),
|
||||
"jvm_args": attr.string_list(),
|
||||
"module": attr.string_list(default = [MODULE]),
|
||||
"module_deps": attr.label_list(allow_files = jar_filetype),
|
||||
"optimize": attr.string(default = "9"),
|
||||
"style": attr.string(default = "OBF"),
|
||||
"user_agent": attr.string(),
|
||||
"deps": attr.label_list(allow_files = jar_filetype),
|
||||
"_jdk": attr.label(
|
||||
default = Label("//tools/defaults:jdk"),
|
||||
),
|
||||
|
@ -63,10 +63,10 @@ def _impl(ctx):
|
||||
|
||||
java_doc = rule(
|
||||
attrs = {
|
||||
"external_docs": attr.string_list(),
|
||||
"libs": attr.label_list(allow_files = False),
|
||||
"pkgs": attr.string_list(),
|
||||
"title": attr.string(),
|
||||
"external_docs": attr.string_list(),
|
||||
"_jdk": attr.label(
|
||||
default = Label("@bazel_tools//tools/jdk:current_java_runtime"),
|
||||
allow_files = True,
|
||||
|
@ -47,9 +47,9 @@ def _npm_binary_impl(ctx):
|
||||
|
||||
npm_binary = repository_rule(
|
||||
attrs = {
|
||||
"repository": attr.string(default = NPMJS),
|
||||
# Label resolves within repo of the .bzl file.
|
||||
"_download_script": attr.label(default = Label("//tools:download_file.py")),
|
||||
"repository": attr.string(default = NPMJS),
|
||||
},
|
||||
local = True,
|
||||
implementation = _npm_binary_impl,
|
||||
@ -130,13 +130,13 @@ def _bash(ctx, cmd):
|
||||
bower_archive = repository_rule(
|
||||
_bower_archive,
|
||||
attrs = {
|
||||
"_bower_archive": attr.label(default = Label("@bower//:%s" % _npm_tarball("bower"))),
|
||||
"_run_npm": attr.label(default = Label("//tools/js:run_npm_binary.py")),
|
||||
"_download_bower": attr.label(default = Label("//tools/js:download_bower.py")),
|
||||
"sha1": attr.string(mandatory = True),
|
||||
"version": attr.string(mandatory = True),
|
||||
"package": attr.string(mandatory = True),
|
||||
"semver": attr.string(),
|
||||
"sha1": attr.string(mandatory = True),
|
||||
"version": attr.string(mandatory = True),
|
||||
"_bower_archive": attr.label(default = Label("@bower//:%s" % _npm_tarball("bower"))),
|
||||
"_download_bower": attr.label(default = Label("//tools/js:download_bower.py")),
|
||||
"_run_npm": attr.label(default = Label("//tools/js:run_npm_binary.py")),
|
||||
},
|
||||
)
|
||||
|
||||
@ -217,12 +217,12 @@ js_component = rule(
|
||||
_bower_component = rule(
|
||||
_bower_component_impl,
|
||||
attrs = dict(_common_attrs.items() + {
|
||||
"zipfile": attr.label(allow_single_file = [".zip"]),
|
||||
"license": attr.label(allow_single_file = True),
|
||||
"version_json": attr.label(allow_files = [".json"]),
|
||||
|
||||
# If set, define by hand, and don't regenerate this entry in bower2bazel.
|
||||
"seed": attr.bool(default = False),
|
||||
"version_json": attr.label(allow_files = [".json"]),
|
||||
"zipfile": attr.label(allow_single_file = [".zip"]),
|
||||
}.items()),
|
||||
)
|
||||
|
||||
@ -291,8 +291,8 @@ bower_component_bundle = rule(
|
||||
_bower_component_bundle_impl,
|
||||
attrs = _common_attrs,
|
||||
outputs = {
|
||||
"zip": "%{name}.zip",
|
||||
"version_json": "%{name}-versions.json",
|
||||
"zip": "%{name}.zip",
|
||||
},
|
||||
)
|
||||
"""Groups a set of bower components together in a zip file.
|
||||
@ -392,11 +392,6 @@ def _vulcanize_impl(ctx):
|
||||
_vulcanize_rule = rule(
|
||||
_vulcanize_impl,
|
||||
attrs = {
|
||||
"deps": attr.label_list(providers = ["transitive_zipfiles"]),
|
||||
"app": attr.label(
|
||||
mandatory = True,
|
||||
allow_single_file = True,
|
||||
),
|
||||
"srcs": attr.label_list(allow_files = [
|
||||
".js",
|
||||
".html",
|
||||
@ -404,7 +399,16 @@ _vulcanize_rule = rule(
|
||||
".css",
|
||||
".ico",
|
||||
]),
|
||||
"app": attr.label(
|
||||
mandatory = True,
|
||||
allow_single_file = True,
|
||||
),
|
||||
"pkg": attr.string(mandatory = True),
|
||||
"deps": attr.label_list(providers = ["transitive_zipfiles"]),
|
||||
"_crisper_archive": attr.label(
|
||||
default = Label("@crisper//:%s" % _npm_tarball("crisper")),
|
||||
allow_single_file = True,
|
||||
),
|
||||
"_run_npm": attr.label(
|
||||
default = Label("//tools/js:run_npm_binary.py"),
|
||||
allow_single_file = True,
|
||||
@ -413,10 +417,6 @@ _vulcanize_rule = rule(
|
||||
default = Label("@vulcanize//:%s" % _npm_tarball("vulcanize")),
|
||||
allow_single_file = True,
|
||||
),
|
||||
"_crisper_archive": attr.label(
|
||||
default = Label("@crisper//:%s" % _npm_tarball("crisper")),
|
||||
allow_single_file = True,
|
||||
),
|
||||
},
|
||||
outputs = {
|
||||
"html": "%{name}.html",
|
||||
|
@ -164,15 +164,15 @@ def _maven_jar_impl(ctx):
|
||||
maven_jar = repository_rule(
|
||||
attrs = {
|
||||
"artifact": attr.string(mandatory = True),
|
||||
"attach_source": attr.bool(default = True),
|
||||
"exclude": attr.string_list(),
|
||||
"repository": attr.string(default = MAVEN_CENTRAL),
|
||||
"sha1": attr.string(),
|
||||
"src_sha1": attr.string(),
|
||||
"_download_script": attr.label(default = Label("//tools:download_file.py")),
|
||||
"repository": attr.string(default = MAVEN_CENTRAL),
|
||||
"attach_source": attr.bool(default = True),
|
||||
"unsign": attr.bool(default = False),
|
||||
"deps": attr.string_list(),
|
||||
"exports": attr.string_list(),
|
||||
"exclude": attr.string_list(),
|
||||
"deps": attr.string_list(),
|
||||
"_download_script": attr.label(default = Label("//tools:download_file.py")),
|
||||
},
|
||||
local = True,
|
||||
implementation = _maven_jar_impl,
|
||||
|
Loading…
x
Reference in New Issue
Block a user