diff --git a/WORKSPACE b/WORKSPACE index ba95d854..c183530e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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. @@ -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 diff --git a/setup.bzl b/setup.bzl index a0786869..70464df6 100644 --- a/setup.bzl +++ b/setup.bzl @@ -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", ) diff --git a/stardoc/BUILD b/stardoc/BUILD index 5971a35c..538e79d2 100644 --- a/stardoc/BUILD +++ b/stardoc/BUILD @@ -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( diff --git a/stardoc/proto/stardoc_output.proto b/stardoc/proto/stardoc_output.proto index 1c46f23f..8e536fd1 100644 --- a/stardoc/proto/stardoc_output.proto +++ b/stardoc/proto/stardoc_output.proto @@ -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. @@ -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 { diff --git a/stardoc/renderer_binary.jar b/stardoc/renderer_binary.jar index c58f1ea7..015372d9 100755 Binary files a/stardoc/renderer_binary.jar and b/stardoc/renderer_binary.jar differ diff --git a/stardoc/stardoc_binary.jar b/stardoc/stardoc_binary.jar index 7ac7dfcf..ea5b1af4 100755 Binary files a/stardoc/stardoc_binary.jar and b/stardoc/stardoc_binary.jar differ diff --git a/test/BUILD b/test/BUILD index 0aba6489..c97b5a4b 100644 --- a/test/BUILD +++ b/test/BUILD @@ -273,4 +273,3 @@ sh_test( "@local_repository_test//:output.md", ], ) - diff --git a/test/stardoc_test.bzl b/test/stardoc_test.bzl index 4db9c50e..8a18b523 100644 --- a/test/stardoc_test.bzl +++ b/test/stardoc_test.bzl @@ -53,7 +53,8 @@ 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, @@ -61,8 +62,10 @@ def stardoc_test( 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, @@ -70,17 +73,19 @@ def stardoc_test( 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( @@ -118,4 +123,3 @@ def _create_test_targets(test_name, ) else: fail("parameter 'test' must either be 'default' or 'html_tables', but was " + test) - diff --git a/test/testdata/attribute_defaults_test/input.bzl b/test/testdata/attribute_defaults_test/input.bzl index fe891f6e..68c83f16 100644 --- a/test/testdata/attribute_defaults_test/input.bzl +++ b/test/testdata/attribute_defaults_test/input.bzl @@ -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(), }, ) diff --git a/test/testdata/fakedeps/dep.bzl b/test/testdata/fakedeps/dep.bzl index bbc89855..1f6a3085 100644 --- a/test/testdata/fakedeps/dep.bzl +++ b/test/testdata/fakedeps/dep.bzl @@ -3,5 +3,3 @@ def give_me_five(): """Returns five.""" return 5 - - diff --git a/test/testdata/filter_rules_test/dep.bzl b/test/testdata/filter_rules_test/dep.bzl index 5c5da10c..1cff158b 100644 --- a/test/testdata/filter_rules_test/dep.bzl +++ b/test/testdata/filter_rules_test/dep.bzl @@ -1,6 +1,6 @@ # buildifier: disable=module-docstring def my_rule_impl(ctx): - return [] + return [] my_rule = rule( implementation = my_rule_impl, diff --git a/test/testdata/local_repository_test/BUILD b/test/testdata/local_repository_test/BUILD index cceb9699..f63d52fc 100644 --- a/test/testdata/local_repository_test/BUILD +++ b/test/testdata/local_repository_test/BUILD @@ -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", ], ) diff --git a/test/testdata/local_repository_test/input.bzl b/test/testdata/local_repository_test/input.bzl index ab5f7dd5..3dbb6dea 100644 --- a/test/testdata/local_repository_test/input.bzl +++ b/test/testdata/local_repository_test/input.bzl @@ -13,5 +13,3 @@ def min(integers): """ _ignore = [integers] return give_me_five() - -