diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 19a8766b..c3ef4e5c 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -98,5 +98,15 @@ tasks: test_flags: *common_flags test_targets: - "//test:proto_format_test_e2e_test" + - "//test:macro_kwargs_legacy_test_e2e_test" + + bazel_8_tests: + name: Stardoc golden tests requiring Bazel HEAD + platform: ubuntu2004 + bazel: last_green + build_flags: *common_flags + test_flags: *common_flags + test_targets: + - "//test:macro_kwargs_test_e2e_test" buildifier: latest diff --git a/docs/stardoc_rule.md b/docs/stardoc_rule.md index 52658ea9..9851880e 100644 --- a/docs/stardoc_rule.md +++ b/docs/stardoc_rule.md @@ -7,10 +7,10 @@ Starlark rule for stardoc: a documentation generator tool written in Java. ## stardoc
-stardoc(name, input, out, deps, format, symbol_names, renderer, aspect_template, func_template, +stardoc(*, name, input, out, deps, format, symbol_names, renderer, aspect_template, func_template, header_template, table_of_contents_template, provider_template, rule_template, repository_rule_template, module_extension_template, footer_template, render_main_repo_name, - stamp, kwargs) + stamp, **kwargs)Generates documentation for exported starlark rule definitions in a target starlark file. diff --git a/src/main/java/com/google/devtools/build/stardoc/rendering/MarkdownUtil.java b/src/main/java/com/google/devtools/build/stardoc/rendering/MarkdownUtil.java index 4ac54ce4..9324bb65 100644 --- a/src/main/java/com/google/devtools/build/stardoc/rendering/MarkdownUtil.java +++ b/src/main/java/com/google/devtools/build/stardoc/rendering/MarkdownUtil.java @@ -16,6 +16,9 @@ import static com.google.common.base.Strings.isNullOrEmpty; import static com.google.common.collect.ImmutableList.toImmutableList; +import static com.google.devtools.build.lib.starlarkdocextract.StardocOutputProtos.FunctionParamRole.PARAM_ROLE_KEYWORD_ONLY; +import static com.google.devtools.build.lib.starlarkdocextract.StardocOutputProtos.FunctionParamRole.PARAM_ROLE_KWARGS; +import static com.google.devtools.build.lib.starlarkdocextract.StardocOutputProtos.FunctionParamRole.PARAM_ROLE_VARARGS; import static java.util.Comparator.naturalOrder; import static java.util.stream.Collectors.joining; @@ -38,6 +41,7 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -247,9 +251,7 @@ private String providerSummaryImpl( String providerName, ProviderInfo providerInfo, String paramAnchorPrefix) { ImmutableList params = providerInfo.hasInit() - ? providerInfo.getInit().getParameterList().stream() - .map(paramInfo -> new Param(paramInfo, paramAnchorPrefix)) - .collect(toImmutableList()) + ? getFunctionParamsInDeclarationOrder(providerInfo.getInit(), paramAnchorPrefix) : providerInfo.getFieldInfoList().stream() .map(fieldInfo -> new Param(fieldInfo, paramAnchorPrefix)) .collect(toImmutableList()); @@ -324,11 +326,9 @@ public String moduleExtensionSummary(String extensionName, ModuleExtensionInfo e */ @SuppressWarnings("unused") // Used by markdown template. public String funcSummary(StarlarkFunctionInfo funcInfo) { - ImmutableList params = - funcInfo.getParameterList().stream() - .map(paramInfo -> new Param(paramInfo, funcInfo.getFunctionName())) - .collect(toImmutableList()); - return summary(funcInfo.getFunctionName(), params); + return summary( + funcInfo.getFunctionName(), + getFunctionParamsInDeclarationOrder(funcInfo, funcInfo.getFunctionName())); } /** @@ -350,15 +350,30 @@ private static String summary(String functionName, ImmutableList params) /** Representation of a callable's parameter in a summary line. */ private static final class Param { - // Parameter name for use in summary line + // User-visible name, including the leading "*" or "**" for residuals final String name; // HTML anchor for the parameter's detailed documentation elsewhere on the page - final String anchorName; + final Optional
-macro_with_args(name, args) +macro_with_args(name, *args)My args macro is OK. @@ -25,12 +25,92 @@ My args macro is OK. An empty list. + + +## macro_with_args_and_kwonly + +
+macro_with_args_and_kwonly(*args, name) ++ +*args and a keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| args | Positional arguments | none | + + + + +## macro_with_args_and_kwonlys + +
+macro_with_args_and_kwonlys(*args, name, number) ++ +*args and several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| args | Positional arguments | none | + + + + +## macro_with_args_kwonly_and_kwargs + +
+macro_with_args_kwonly_and_kwargs(*args, name, **kwargs) ++ +*args, a keyword-only param, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| args | Positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_args_kwonlys_and_kwargs + +
+macro_with_args_kwonlys_and_kwargs(*args, name, number, **kwargs) ++ +*args, several keyword-only params, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| args | Positional arguments | none | +| kwargs | Other named arguments | none | + + ## macro_with_both
-macro_with_both(name, number, args, kwargs) +macro_with_both(name, number, *args, **kwargs)Oh wow this macro has both. @@ -58,7 +138,7 @@ An empty list. ## macro_with_kwargs
-macro_with_kwargs(name, config, deps, kwargs) +macro_with_kwargs(name, config, deps, **kwargs)My kwargs macro is the best. @@ -85,3 +165,302 @@ vel mollis eros pellentesque. An empty list. + + +## macro_with_kwonly + +
+macro_with_kwonly(*, name) ++ +One keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | + + + + +## macro_with_kwonly_and_kwargs + +
+macro_with_kwonly_and_kwargs(*, name, **kwargs) ++ +One keyword-only param and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_kwonlys + +
+macro_with_kwonlys(*, name, number) ++ +Several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | + + + + +## macro_with_kwonlys_and_kwargs + +
+macro_with_kwonlys_and_kwargs(*, name, number, **kwargs) ++ +Several keyword-only params and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| kwargs | Other named arguments | none | + + + + +## macro_with_only_args + +
+macro_with_only_args(*args) ++ +Macro only taking *args + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| args | Positional arguments | none | + + + + +## macro_with_only_args_and_kwargs + +
+macro_with_only_args_and_kwargs(*args, **kwargs) ++ +Macro only taking *args and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| args | Positional arguments | none | +| kwargs | Named arguments | none | + + + + +## macro_with_only_kwargs + +
+macro_with_only_kwargs(**kwargs) ++ +Macro only taking **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| kwargs | Named arguments | none | + + + + +## macro_with_ordinary_param_and_kwonlys + +
+macro_with_ordinary_param_and_kwonlys(name, *, number, config) ++ +One ordinary param and several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | + + + + +## macro_with_ordinary_param_args_and_kwonlys + +
+macro_with_ordinary_param_args_and_kwonlys(name, *args, number, config) ++ +One ordinary param, *args, and several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | +| args | Positional arguments | none | + + + + +## macro_with_ordinary_param_args_kwonlys_and_kwargs + +
+macro_with_ordinary_param_args_kwonlys_and_kwargs(name, *args, number, config, **kwargs) ++ +One ordinary param, *args, several keyword-only params, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | +| args | Other positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_ordinary_param_kwonlys_and_kwargs + +
+macro_with_ordinary_param_kwonlys_and_kwargs(name, *, number, config, **kwargs) ++ +One ordinary param, several keyword-only params, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_ordinary_params_and_kwonly + +
+macro_with_ordinary_params_and_kwonly(name, number, *, config) ++ +Several ordinary params and a keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | + + + + +## macro_with_ordinary_params_args_and_kwonly + +
+macro_with_ordinary_params_args_and_kwonly(name, number, *args, config) ++ +Several ordinary params, *args, and a keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | +| args | Positional arguments | none | + + + + +## macro_with_ordinary_params_args_kwonly_and_kwargs + +
+macro_with_ordinary_params_args_kwonly_and_kwargs(name, number, *args, config, **kwargs) ++ +Several ordinary params, *args, one keyword-only param, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | +| args | Other positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_ordinary_params_kwonly_and_kwargs + +
+macro_with_ordinary_params_kwonly_and_kwargs(name, number, *, config, **kwargs) ++ +Several ordinary params, a keyword-only param, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | +| kwargs | Other named arguments | none | + + diff --git a/test/testdata/macro_kwargs_test/input.bzl b/test/testdata/macro_kwargs_test/input.bzl index 8de782e2..844899d9 100644 --- a/test/testdata/macro_kwargs_test/input.bzl +++ b/test/testdata/macro_kwargs_test/input.bzl @@ -50,3 +50,211 @@ def macro_with_both(name, number = 3, *args, **kwargs): """ _ignore = [name, number, args, kwargs] # @unused return [] + +# buildifier: disable=unused-variable +def macro_with_only_args(*args): + """Macro only taking *args + + Args: + *args: Positional arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_only_kwargs(**kwargs): + """Macro only taking **kwargs + + Args: + **kwargs: Named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_only_args_and_kwargs(*args, **kwargs): + """Macro only taking *args and **kwargs + + Args: + *args: Positional arguments + **kwargs: Named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_kwonly(*, name): + """One keyword-only param + + Args: + name: The name + """ + pass + +# buildifier: disable=unused-variable +def macro_with_kwonlys(*, name, number = 3): + """Several keyword-only params + + Args: + name: The name + number: The number + """ + pass + +# buildifier: disable=unused-variable +def macro_with_kwonly_and_kwargs(*, name, **kwargs): + """One keyword-only param and **kwargs + + Args: + name: The name + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_kwonlys_and_kwargs(*, name, number = 3, **kwargs): + """Several keyword-only params and **kwargs + + Args: + name: The name + number: The number + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_params_and_kwonly(name, number = 3, *, config): + """Several ordinary params and a keyword-only param + + Args: + name: The name + number: The number + config: Configuration + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_param_and_kwonlys(name, *, number, config): + """One ordinary param and several keyword-only params + + Args: + name: The name + number: The number + config: Configuration + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_param_kwonlys_and_kwargs(name, *, number, config, **kwargs): + """One ordinary param, several keyword-only params, and **kwargs + + Args: + name: The name + number: The number + config: Configuration + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_params_kwonly_and_kwargs(name, number = 3, *, config, **kwargs): + """Several ordinary params, a keyword-only param, and **kwargs + + Args: + name: The name + number: The number + config: Configuration + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_args_and_kwonly(*args, name): + """*args and a keyword-only param + + Args: + *args: Positional arguments + name: The name + """ + pass + +# buildifier: disable=unused-variable +def macro_with_args_and_kwonlys(*args, name, number = 3): + """*args and several keyword-only params + + Args: + *args: Positional arguments + name: The name + number: The number + """ + pass + +# buildifier: disable=unused-variable +def macro_with_args_kwonly_and_kwargs(*args, name, **kwargs): + """*args, a keyword-only param, and **kwargs + + Args: + *args: Positional arguments + name: The name + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_args_kwonlys_and_kwargs(*args, name, number = 3, **kwargs): + """*args, several keyword-only params, and **kwargs + + Args: + *args: Positional arguments + name: The name + number: The number + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_params_args_and_kwonly(name, number = 3, *args, config): + """Several ordinary params, *args, and a keyword-only param + + Args: + name: The name + number: The number + *args: Positional arguments + config: Configuration + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_param_args_and_kwonlys(name, *args, number, config): + """One ordinary param, *args, and several keyword-only params + + Args: + name: The name + *args: Positional arguments + number: The number + config: Configuration + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_param_args_kwonlys_and_kwargs(name, *args, number, config, **kwargs): + """One ordinary param, *args, several keyword-only params, and **kwargs + + Args: + name: The name + *args: Other positional arguments + number: The number + config: Configuration + **kwargs: Other named arguments + """ + pass + +# buildifier: disable=unused-variable +def macro_with_ordinary_params_args_kwonly_and_kwargs(name, number = 3, *args, config, **kwargs): + """Several ordinary params, *args, one keyword-only param, and **kwargs + + Args: + name: The name + number: The number + *args: Other positional arguments + config: Configuration + **kwargs: Other named arguments + """ + pass diff --git a/test/testdata/macro_kwargs_test/legacy_golden.md b/test/testdata/macro_kwargs_test/legacy_golden.md new file mode 100644 index 00000000..0b1f0403 --- /dev/null +++ b/test/testdata/macro_kwargs_test/legacy_golden.md @@ -0,0 +1,466 @@ + + +Tests for functions which use *args or **kwargs + + + +## macro_with_args + +
+macro_with_args(name, args) ++ +My args macro is OK. + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name of the test rule. | none | +| args | Other arguments to include | none | + +**RETURNS** + +An empty list. + + + + +## macro_with_args_and_kwonly + +
+macro_with_args_and_kwonly(name, args) ++ +*args and a keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| args | Positional arguments | none | + + + + +## macro_with_args_and_kwonlys + +
+macro_with_args_and_kwonlys(name, number, args) ++ +*args and several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| args | Positional arguments | none | + + + + +## macro_with_args_kwonly_and_kwargs + +
+macro_with_args_kwonly_and_kwargs(name, args, kwargs) ++ +*args, a keyword-only param, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| args | Positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_args_kwonlys_and_kwargs + +
+macro_with_args_kwonlys_and_kwargs(name, number, args, kwargs) ++ +*args, several keyword-only params, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| args | Positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_both + +
+macro_with_both(name, number, args, kwargs) ++ +Oh wow this macro has both. + +Not much else to say. + + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name of the test rule. | none | +| number | Some number used for important things | `3` | +| args | Other arguments to include | none | +| kwargs | Other attributes to include | none | + +**RETURNS** + +An empty list. + + + + +## macro_with_kwargs + +
+macro_with_kwargs(name, config, deps, kwargs) ++ +My kwargs macro is the best. + +This is a long multi-line doc string. +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer +elementum, diam vitae tincidunt pulvinar, nunc tortor volutpat dui, +vitae facilisis odio ligula a tortor. Donec ullamcorper odio eget ipsum tincidunt, +vel mollis eros pellentesque. + + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name of the test rule. | none | +| config | Config to use for my macro | none | +| deps | List of my macro's dependencies | `[]` | +| kwargs | Other attributes to include | none | + +**RETURNS** + +An empty list. + + + + +## macro_with_kwonly + +
+macro_with_kwonly(name) ++ +One keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | + + + + +## macro_with_kwonly_and_kwargs + +
+macro_with_kwonly_and_kwargs(name, kwargs) ++ +One keyword-only param and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_kwonlys + +
+macro_with_kwonlys(name, number) ++ +Several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | + + + + +## macro_with_kwonlys_and_kwargs + +
+macro_with_kwonlys_and_kwargs(name, number, kwargs) ++ +Several keyword-only params and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| kwargs | Other named arguments | none | + + + + +## macro_with_only_args + +
+macro_with_only_args(args) ++ +Macro only taking *args + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| args | Positional arguments | none | + + + + +## macro_with_only_args_and_kwargs + +
+macro_with_only_args_and_kwargs(args, kwargs) ++ +Macro only taking *args and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| args | Positional arguments | none | +| kwargs | Named arguments | none | + + + + +## macro_with_only_kwargs + +
+macro_with_only_kwargs(kwargs) ++ +Macro only taking **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| kwargs | Named arguments | none | + + + + +## macro_with_ordinary_param_and_kwonlys + +
+macro_with_ordinary_param_and_kwonlys(name, number, config) ++ +One ordinary param and several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | + + + + +## macro_with_ordinary_param_args_and_kwonlys + +
+macro_with_ordinary_param_args_and_kwonlys(name, number, config, args) ++ +One ordinary param, *args, and several keyword-only params + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | +| args | Positional arguments | none | + + + + +## macro_with_ordinary_param_args_kwonlys_and_kwargs + +
+macro_with_ordinary_param_args_kwonlys_and_kwargs(name, number, config, args, kwargs) ++ +One ordinary param, *args, several keyword-only params, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | +| args | Other positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_ordinary_param_kwonlys_and_kwargs + +
+macro_with_ordinary_param_kwonlys_and_kwargs(name, number, config, kwargs) ++ +One ordinary param, several keyword-only params, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | none | +| config | Configuration | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_ordinary_params_and_kwonly + +
+macro_with_ordinary_params_and_kwonly(name, number, config) ++ +Several ordinary params and a keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | + + + + +## macro_with_ordinary_params_args_and_kwonly + +
+macro_with_ordinary_params_args_and_kwonly(name, number, config, args) ++ +Several ordinary params, *args, and a keyword-only param + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | +| args | Positional arguments | none | + + + + +## macro_with_ordinary_params_args_kwonly_and_kwargs + +
+macro_with_ordinary_params_args_kwonly_and_kwargs(name, number, config, args, kwargs) ++ +Several ordinary params, *args, one keyword-only param, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | +| args | Other positional arguments | none | +| kwargs | Other named arguments | none | + + + + +## macro_with_ordinary_params_kwonly_and_kwargs + +
+macro_with_ordinary_params_kwonly_and_kwargs(name, number, config, kwargs) ++ +Several ordinary params, a keyword-only param, and **kwargs + +**PARAMETERS** + + +| Name | Description | Default Value | +| :------------- | :------------- | :------------- | +| name | The name | none | +| number | The number | `3` | +| config | Configuration | none | +| kwargs | Other named arguments | none | + + diff --git a/update-stardoc-tests.sh b/update-stardoc-tests.sh index dca9b181..c79f50b1 100755 --- a/update-stardoc-tests.sh +++ b/update-stardoc-tests.sh @@ -37,7 +37,7 @@ function run_buildozer () { # Some tests cannot be automatically regenerated using this script, as they don't fall under the normal # golden test pattern or require a specific Bazel version -EXCLUDED_TESTS="namespace_test_with_allowlist|multi_level_namespace_test_with_allowlist|local_repository_test|stamping_with_stamping_off" +EXCLUDED_TESTS="namespace_test_with_allowlist|multi_level_namespace_test_with_allowlist|local_repository_test|stamping_with_stamping_off|macro_kwargs" echo "** Querying for tests..." regen_targets=$(${BAZEL} query //test:all | grep regenerate_ | grep -vE "_golden\.extract|$EXCLUDED_TESTS")