Skip to content

Commit

Permalink
Update binaries. (#97)
Browse files Browse the repository at this point in the history
... and run buildifier to make buildkite happy.
  • Loading branch information
tetromino committed Apr 22, 2021
1 parent 8275ced commit d93ee53
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 26 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ git_repository(
name = "io_bazel",
commit = "cfebb18ad206162c1309962e8d396a5fd0ef234e", # Dec 30, 2020
remote = "https://github.com/bazelbuild/bazel.git",
shallow_since = "1609373204 -0800"
shallow_since = "1609373204 -0800",
)

# The following binds are needed for building protobuf java libraries.
Expand Down Expand Up @@ -50,7 +50,7 @@ git_repository(
name = "rules_python",
commit = "4b84ad270387a7c439ebdccfd530e2339601ef27",
remote = "https://github.com/bazelbuild/rules_python.git",
shallow_since = "1564776078 -0400"
shallow_since = "1564776078 -0400",
)

# Needed as a transitive dependency of @io_bazel
Expand Down
2 changes: 1 addition & 1 deletion setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def stardoc_repositories():
_include_if_not_defined(
http_archive,
name = "bazel_skylib",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/16de038c484145363340eeaf0e97a0c9889a931b.tar.gz"], # 2020-08-11
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/16de038c484145363340eeaf0e97a0c9889a931b.tar.gz"], # 2020-08-11
sha256 = "96e0cd3f731f0caef9e9919aa119ecc6dace36b149c2f47e40aa50587790402b",
strip_prefix = "bazel-skylib-16de038c484145363340eeaf0e97a0c9889a931b",
)
Expand Down
2 changes: 1 addition & 1 deletion stardoc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ filegroup(
bzl_library(
name = "stardoc_lib",
srcs = ["stardoc.bzl"],
visibility = ["//visibility:public"],
deps = [
"@bazel_skylib//:bzl_library",
],
visibility = ["//visibility:public"],
)

stardoc(
Expand Down
18 changes: 18 additions & 0 deletions stardoc/proto/stardoc_output.proto
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ message StarlarkFunctionInfo {
// The documented description of the function (if specified in the function's
// docstring).
string doc_string = 3;

// The return value for the function.
FunctionReturnInfo return = 4;

// The deprecation for the function.
FunctionDeprecationInfo deprecated = 5;
}

// Representation of a Starlark function parameter definition.
Expand All @@ -144,6 +150,18 @@ message FunctionParamInfo {
bool mandatory = 4;
}

message FunctionReturnInfo {
// The documented return value of the function (if specified in the function's
// docstring).
string doc_string = 1;
}

message FunctionDeprecationInfo {
// The documented deprecation of the function (if specified in the function's
// docstring).
string doc_string = 1;
}

// Representation of a Starlark provider field definition, comprised of
// the field name and provider description.
message ProviderFieldInfo {
Expand Down
Binary file modified stardoc/renderer_binary.jar
Binary file not shown.
Binary file modified stardoc/stardoc_binary.jar
Binary file not shown.
1 change: 0 additions & 1 deletion test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -273,4 +273,3 @@ sh_test(
"@local_repository_test//:output.md",
],
)

32 changes: 18 additions & 14 deletions test/stardoc_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,39 @@ def stardoc_test(
srcs = [input_file],
deps = deps,
)
_create_test_targets(test_name = "%s_e2e_test" % name,
_create_test_targets(
test_name = "%s_e2e_test" % name,
genrule_name = "regenerate_%s_golden" % name,
lib_name = "%s_lib" % name,
input_file = input_file,
golden_file = golden_file,
stardoc_bin = "@io_bazel//src/main/java/com/google/devtools/build/skydoc",
renderer_bin = "@io_bazel//src/main/java/com/google/devtools/build/skydoc/renderer",
test = test,
**kwargs)
_create_test_targets(test_name = "%s_e2e_jar_test" % name,
**kwargs
)
_create_test_targets(
test_name = "%s_e2e_jar_test" % name,
genrule_name = "regenerate_with_jar_%s_golden" % name,
lib_name = "%s_lib" % name,
input_file = input_file,
golden_file = golden_file,
stardoc_bin = "@io_bazel//src/main/java/com/google/devtools/build/skydoc",
renderer_bin = "@io_bazel//src/main/java/com/google/devtools/build/skydoc/renderer",
test = test,
**kwargs)
**kwargs
)

def _create_test_targets(test_name,
genrule_name,
lib_name,
input_file,
golden_file,
stardoc_bin,
renderer_bin,
test,
**kwargs):
def _create_test_targets(
test_name,
genrule_name,
lib_name,
input_file,
golden_file,
stardoc_bin,
renderer_bin,
test,
**kwargs):
actual_generated_doc = "%s.out" % genrule_name

native.sh_test(
Expand Down Expand Up @@ -118,4 +123,3 @@ def _create_test_targets(test_name,
)
else:
fail("parameter 'test' must either be 'default' or 'html_tables', but was " + test)

2 changes: 1 addition & 1 deletion test/testdata/attribute_defaults_test/input.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ my_rule = rule(
"t": attr.string_list_dict(mandatory = True, doc = "Some string_list_dict"),
"u": attr.string(),
"v": attr.label(),
"w": attr.int()
"w": attr.int(),
},
)
2 changes: 0 additions & 2 deletions test/testdata/fakedeps/dep.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
def give_me_five():
"""Returns five."""
return 5


2 changes: 1 addition & 1 deletion test/testdata/filter_rules_test/dep.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# buildifier: disable=module-docstring
def my_rule_impl(ctx):
return []
return []

my_rule = rule(
implementation = my_rule_impl,
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/local_repository_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ bzl_library(
name = "lib",
srcs = [
"input.bzl",
"@io_bazel_skydoc//test:testdata/fakedeps/dep.bzl"
"@io_bazel_skydoc//test:testdata/fakedeps/dep.bzl",
],
)
2 changes: 0 additions & 2 deletions test/testdata/local_repository_test/input.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,3 @@ def min(integers):
"""
_ignore = [integers]
return give_me_five()


0 comments on commit d93ee53

Please sign in to comment.