Skip to content

Commit

Permalink
Fix buildifier formatting errors (bazelbuild#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
nimerritt authored and erain committed May 18, 2018
1 parent e5ebe3d commit 12a4a55
Show file tree
Hide file tree
Showing 20 changed files with 151 additions and 149 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ workspace(name = "io_bazel_rules_docker")

load(
"//container:container.bzl",
"container_pull",
"container_load",
"container_pull",
container_repositories = "repositories",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand Down Expand Up @@ -113,7 +113,7 @@ http_archive(
urls = ["https://github.com/bazelbuild/rules_go/archive/0.12.0.tar.gz"],
)

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
load("@io_bazel_rules_go//go:def.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

Expand Down
2 changes: 1 addition & 1 deletion cc/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The signature of this rule is compatible with cc_binary.

load(
"//lang:image.bzl",
"dep_layer",
"app_layer",
"dep_layer",
)
load(
"//container:container.bzl",
Expand Down
14 changes: 7 additions & 7 deletions container/container.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def repositories():
tag = CONTAINERREGISTRY_RELEASE,
)

# TODO(mattmoor): Remove all of this (copied from google/containerregistry)
# once transitive workspace instantiation lands.
# TODO(mattmoor): Remove all of this (copied from google/containerregistry)
# once transitive workspace instantiation lands.

if "httplib2" not in excludes:
# TODO(mattmoor): Is there a clean way to override?
Expand All @@ -82,7 +82,7 @@ py_library(
)""",
)

# Used by oauth2client
# Used by oauth2client
if "six" not in excludes:
# TODO(mattmoor): Is there a clean way to override?
native.new_http_archive(
Expand All @@ -106,7 +106,7 @@ py_library(
)""",
)

# Used for authentication in containerregistry
# Used for authentication in containerregistry
if "oauth2client" not in excludes:
# TODO(mattmoor): Is there a clean way to override?
native.new_http_archive(
Expand All @@ -127,7 +127,7 @@ py_library(
)""",
)

# Used for parallel execution in containerregistry
# Used for parallel execution in containerregistry
if "concurrent" not in excludes:
# TODO(mattmoor): Is there a clean way to override?
native.new_http_archive(
Expand All @@ -144,7 +144,7 @@ py_library(
)""",
)

# For packaging python tools.
# For packaging python tools.
if "subpar" not in excludes:
native.git_repository(
name = "subpar",
Expand All @@ -159,7 +159,7 @@ py_library(
commit = STRUCTURE_TEST_COMMIT,
)

# For skylark_library.
# For skylark_library.
if "bazel_skylib" not in excludes:
native.git_repository(
name = "bazel_skylib",
Expand Down
161 changes: 81 additions & 80 deletions container/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ def _repository_name(ctx):
if ctx.attr.legacy_repository_naming:
# Legacy behavior, off by default.
return _join_path(ctx.attr.repository, ctx.label.package.replace("/", "_"))
# Newer Docker clients support multi-level names, which are a part of
# the v2 registry specification.

# Newer Docker clients support multi-level names, which are a part of
# the v2 registry specification.

return _join_path(ctx.attr.repository, ctx.label.package)

Expand Down Expand Up @@ -281,7 +282,7 @@ def _impl(
layer_name = str(i),
)

# Construct a temporary name based on the build target.
# Construct a temporary name based on the build target.
tag_name = _repository_name(ctx) + ":" + name

# These are the constituent parts of the Container image, which each
Expand Down Expand Up @@ -413,83 +414,83 @@ def _validate_command(name, argument):
else:
return None

# Produces a new container image tarball compatible with 'docker load', which
# is a single additional layer atop 'base'. The goal is to have relatively
# complete support for building container image, from the Dockerfile spec.
#
# For more information see the 'Config' section of the image specification:
# https://github.com/opencontainers/image-spec/blob/v0.2.0/serialization.md
#
# Only 'name' is required. All other fields have sane defaults.
#
# container_image(
# name="...",
# visibility="...",
#
# # The base layers on top of which to overlay this layer,
# # equivalent to FROM.
# base="//another/build:rule",
#
# # The base directory of the files, defaulted to
# # the package of the input.
# # All files structure relatively to that path will be preserved.
# # A leading '/' mean the workspace root and this path is relative
# # to the current package by default.
# data_path="...",
#
# # The directory in which to expand the specified files,
# # defaulting to '/'.
# # Only makes sense accompanying one of files/tars/debs.
# directory="...",
#
# # The set of archives to expand, or packages to install
# # within the chroot of this layer
# files=[...],
# tars=[...],
# debs=[...],
#
# # The set of symlinks to create within a given layer.
# symlinks = {
# "/path/to/link": "/path/to/target",
# ...
# },
#
# # Other layers built from container_layer rule
# layers = [":c-lang-layer", ":java-lang-layer", ...]
#
# # https://docs.docker.com/engine/reference/builder/#entrypoint
# entrypoint="...", or
# entrypoint=[...], -- exec form
#
# # https://docs.docker.com/engine/reference/builder/#cmd
# cmd="...", or
# cmd=[...], -- exec form
#
# # https://docs.docker.com/engine/reference/builder/#expose
# ports=[...],
#
# # https://docs.docker.com/engine/reference/builder/#user
# # NOTE: the normal directive affects subsequent RUN, CMD,
# # and ENTRYPOINT
# user="...",
#
# # https://docs.docker.com/engine/reference/builder/#volume
# volumes=[...],
#
# # https://docs.docker.com/engine/reference/builder/#workdir
# # NOTE: the normal directive affects subsequent RUN, CMD,
# # ENTRYPOINT, ADD, and COPY, but this attribute only affects
# # the entry point.
# workdir="...",
#
# # https://docs.docker.com/engine/reference/builder/#env
# env = {
# "var1": "val1",
# "var2": "val2",
# ...
# "varN": "valN",
# },
# )
# Produces a new container image tarball compatible with 'docker load', which
# is a single additional layer atop 'base'. The goal is to have relatively
# complete support for building container image, from the Dockerfile spec.
#
# For more information see the 'Config' section of the image specification:
# https://github.com/opencontainers/image-spec/blob/v0.2.0/serialization.md
#
# Only 'name' is required. All other fields have sane defaults.
#
# container_image(
# name="...",
# visibility="...",
#
# # The base layers on top of which to overlay this layer,
# # equivalent to FROM.
# base="//another/build:rule",
#
# # The base directory of the files, defaulted to
# # the package of the input.
# # All files structure relatively to that path will be preserved.
# # A leading '/' mean the workspace root and this path is relative
# # to the current package by default.
# data_path="...",
#
# # The directory in which to expand the specified files,
# # defaulting to '/'.
# # Only makes sense accompanying one of files/tars/debs.
# directory="...",
#
# # The set of archives to expand, or packages to install
# # within the chroot of this layer
# files=[...],
# tars=[...],
# debs=[...],
#
# # The set of symlinks to create within a given layer.
# symlinks = {
# "/path/to/link": "/path/to/target",
# ...
# },
#
# # Other layers built from container_layer rule
# layers = [":c-lang-layer", ":java-lang-layer", ...]
#
# # https://docs.docker.com/engine/reference/builder/#entrypoint
# entrypoint="...", or
# entrypoint=[...], -- exec form
#
# # https://docs.docker.com/engine/reference/builder/#cmd
# cmd="...", or
# cmd=[...], -- exec form
#
# # https://docs.docker.com/engine/reference/builder/#expose
# ports=[...],
#
# # https://docs.docker.com/engine/reference/builder/#user
# # NOTE: the normal directive affects subsequent RUN, CMD,
# # and ENTRYPOINT
# user="...",
#
# # https://docs.docker.com/engine/reference/builder/#volume
# volumes=[...],
#
# # https://docs.docker.com/engine/reference/builder/#workdir
# # NOTE: the normal directive affects subsequent RUN, CMD,
# # ENTRYPOINT, ADD, and COPY, but this attribute only affects
# # the entry point.
# workdir="...",
#
# # https://docs.docker.com/engine/reference/builder/#env
# env = {
# "var1": "val1",
# "var2": "val2",
# ...
# "varN": "valN",
# },
# )

def container_image(**kwargs):
"""Package a docker image.
Expand Down
4 changes: 2 additions & 2 deletions container/import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def _container_import_impl(ctx):
unzipped_layers += [unzipped]
diff_ids += [diff_id]

# These are the constituent parts of the Container image, which each
# rule in the chain must preserve.
# These are the constituent parts of the Container image, which each
# rule in the chain must preserve.

container_parts = {
# The path to the v2.2 configuration file.
Expand Down
2 changes: 1 addition & 1 deletion container/layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def zip_layer(ctx, layer):
zipped_layer = _gzip(ctx, layer)
return zipped_layer, _sha256(ctx, zipped_layer)

# A provider containing information needed in container_image and other rules.
# A provider containing information needed in container_image and other rules.

LayerInfo = provider(fields = [
"zipped_layer",
Expand Down
4 changes: 2 additions & 2 deletions container/layer_tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def incremental_load(
if stamp:
stamp_files = [ctx.info_file, ctx.version_file]

# Default to interactively launching the container,
# and cleaning up when it exits.
# Default to interactively launching the container,
# and cleaning up when it exits.

run_flags = run_flags or "-i --rm"

Expand Down
2 changes: 1 addition & 1 deletion contrib/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _impl(ctx):
load_statement = "docker load -i %s" % ctx.file.image_tar.short_path
image_name = ctx.attr.image_name

# Generate a shell script to execute structure_tests with the correct flags.
# Generate a shell script to execute structure_tests with the correct flags.
ctx.actions.expand_template(
template = ctx.file._structure_test_tpl,
output = ctx.outputs.executable,
Expand Down
2 changes: 1 addition & 1 deletion d/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The signature of this rule is compatible with d_binary.

load(
"//lang:image.bzl",
"dep_layer",
"app_layer",
"dep_layer",
)
load(
"//cc:image.bzl",
Expand Down
2 changes: 1 addition & 1 deletion go/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The signature of this rule is compatible with go_binary.

load(
"//lang:image.bzl",
"dep_layer",
"app_layer",
"dep_layer",
)
load(
"//container:container.bzl",
Expand Down
4 changes: 2 additions & 2 deletions groovy/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ load("//container:container.bzl", "container_image")
load(
"//java:image.bzl",
"DEFAULT_JAVA_BASE",
"jar_dep_layer",
"jar_app_layer",
"jar_dep_layer",
_repositories = "repositories",
)

Expand Down Expand Up @@ -54,7 +54,7 @@ def groovy_image(
)
deps = deps + [binary_name + "-lib"]

# This always belongs in a separate layer.
# This always belongs in a separate layer.
layers = layers + ["//external:groovy"]

native.java_binary(
Expand Down
8 changes: 4 additions & 4 deletions java/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ def _jar_app_layer_impl(ctx):
for jar in ctx.attr.jar_layers:
available += java_files(jar)

# We compute the set of unavailable stuff by walking deps
# in the same way, adding in our binary and then subtracting
# out what it available.
# We compute the set of unavailable stuff by walking deps
# in the same way, adding in our binary and then subtracting
# out what it available.

unavailable = depset()
for jar in ctx.attr.deps + ctx.attr.runtime_deps:
Expand Down Expand Up @@ -314,7 +314,7 @@ def _war_app_layer_impl(ctx):
for jar in ctx.attr.jar_layers:
available += java_files(jar)

# This is based on rules_appengine's WAR rules.
# This is based on rules_appengine's WAR rules.
transitive_deps = depset()
transitive_deps += java_files(ctx.attr.library)

Expand Down
Loading

0 comments on commit 12a4a55

Please sign in to comment.