From 8c51351175370d6d82f12cdcea8f49d96dec743d Mon Sep 17 00:00:00 2001 From: Hao Feng Date: Fri, 14 Feb 2020 17:07:03 -0800 Subject: [PATCH 1/3] Do not print the line if the docstring is empty. --- stardoc/templates/markdown_tables/rule.vm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stardoc/templates/markdown_tables/rule.vm b/stardoc/templates/markdown_tables/rule.vm index 0f6ba1c0..383ff1f6 100644 --- a/stardoc/templates/markdown_tables/rule.vm +++ b/stardoc/templates/markdown_tables/rule.vm @@ -15,6 +15,8 @@ ${ruleInfo.docString} | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | #foreach ($attribute in $ruleInfo.getAttributeList()) -| $attribute.name | #if(!$attribute.docString.isEmpty()) ${util.markdownCellFormat($attribute.docString)} #else - #end | ${util.attributeTypeString($attribute)} | ${util.mandatoryString($attribute)} | $attribute.defaultValue | +#if(!$attribute.docString.isEmpty()) +| $attribute.name | ${util.markdownCellFormat($attribute.docString)} | ${util.attributeTypeString($attribute)} | ${util.mandatoryString($attribute)} | $attribute.defaultValue | +#end #end #end From ca420cb66f68d1aaa1f33885232824184367d347 Mon Sep 17 00:00:00 2001 From: Hao Feng Date: Fri, 14 Feb 2020 17:20:10 -0800 Subject: [PATCH 2/3] Updates for other templates. --- stardoc/templates/markdown_tables/aspect.vm | 4 +++- stardoc/templates/markdown_tables/func.vm | 4 +++- stardoc/templates/markdown_tables/provider.vm | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stardoc/templates/markdown_tables/aspect.vm b/stardoc/templates/markdown_tables/aspect.vm index cfa34680..df328d5a 100644 --- a/stardoc/templates/markdown_tables/aspect.vm +++ b/stardoc/templates/markdown_tables/aspect.vm @@ -27,6 +27,8 @@ $aspectInfo.getDocString() | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | #foreach ($attribute in $aspectInfo.getAttributeList()) -| $attribute.name | #if(!$attribute.docString.isEmpty()) ${util.markdownCellFormat($attribute.docString)} #else - #end | ${util.attributeTypeString($attribute)} | ${util.mandatoryString($attribute)} | $attribute.defaultValue | +#if(!$attribute.docString.isEmpty()) +| $attribute.name | ${util.markdownCellFormat($attribute.docString)} | ${util.attributeTypeString($attribute)} | ${util.mandatoryString($attribute)} | $attribute.defaultValue | +#end #end #end diff --git a/stardoc/templates/markdown_tables/func.vm b/stardoc/templates/markdown_tables/func.vm index 81123168..043b8155 100644 --- a/stardoc/templates/markdown_tables/func.vm +++ b/stardoc/templates/markdown_tables/func.vm @@ -15,6 +15,8 @@ ${funcInfo.docString} | Name | Description | Default Value | | :------------- | :------------- | :------------- | #foreach ($param in $funcInfo.getParameterList()) -| $param.name | #if(!$param.docString.isEmpty()) ${util.markdownCellFormat($param.docString)} #else

-

#end | #if(!$param.getDefaultValue().isEmpty()) $param.getDefaultValue() #else none #end| +#if(!$param.docString.isEmpty()) +| $param.name | ${util.markdownCellFormat($param.docString)} | #if(!$param.getDefaultValue().isEmpty()) $param.getDefaultValue() #else none #end| +#end #end #end diff --git a/stardoc/templates/markdown_tables/provider.vm b/stardoc/templates/markdown_tables/provider.vm index b157611b..75184623 100644 --- a/stardoc/templates/markdown_tables/provider.vm +++ b/stardoc/templates/markdown_tables/provider.vm @@ -15,6 +15,8 @@ ${providerInfo.docString} | Name | Description | | :------------- | :------------- | #foreach ($field in $providerInfo.fieldInfoList) -| $field.name | #if(!$field.docString.isEmpty()) ${util.markdownCellFormat($field.docString)} #else - #end | +#if(!$field.docString.isEmpty()) +| $field.name | ${util.markdownCellFormat($field.docString)} | +#end #end #end From 65108f9d2f59251a8f73ddf0aeedcb15be53a094 Mon Sep 17 00:00:00 2001 From: Hao Feng Date: Fri, 14 Feb 2020 17:40:12 -0800 Subject: [PATCH 3/3] Update golden file tests. --- docs/stardoc_rule.md | 28 +++++------ test/testdata/android_basic_test/golden.md | 6 +-- test/testdata/angle_bracket_test/golden.md | 12 ++--- test/testdata/apple_basic_test/golden.md | 6 +-- test/testdata/aspect_test/golden.md | 8 +-- .../attribute_defaults_test/golden.md | 50 +++++++++---------- test/testdata/attribute_types_test/golden.md | 26 +++++----- test/testdata/cc_api_test/golden.md | 7 +-- test/testdata/config_apis_test/golden.md | 5 +- test/testdata/cpp_basic_test/golden.md | 6 +-- test/testdata/filter_rules_test/golden.md | 10 ++-- test/testdata/function_basic_test/golden.md | 15 ++---- test/testdata/generated_bzl_test/golden.md | 5 +- test/testdata/java_basic_test/golden.md | 6 +-- test/testdata/local_repository_test/golden.md | 2 +- test/testdata/macro_kwargs_test/golden.md | 20 ++++---- test/testdata/misc_apis_test/golden.md | 16 +++--- .../multi_level_namespace_test/golden.md | 6 +-- .../golden.md | 2 - test/testdata/multiple_files_test/golden.md | 16 ++---- test/testdata/multiple_rules_test/golden.md | 12 ++--- test/testdata/namespace_test/golden.md | 10 ++-- test/testdata/provider_basic_test/golden.md | 8 +-- .../providers_for_attributes_test/golden.md | 14 ++---- test/testdata/py_rule_test/golden.md | 12 ++--- test/testdata/repo_rules_test/golden.md | 4 +- test/testdata/same_level_file_test/golden.md | 5 +- test/testdata/simple_test/golden.md | 8 ++- .../struct_default_value_test/golden.md | 10 ++-- test/testdata/unknown_name_test/golden.md | 1 - 30 files changed, 134 insertions(+), 202 deletions(-) diff --git a/docs/stardoc_rule.md b/docs/stardoc_rule.md index bcc50d7a..a4f2cf29 100644 --- a/docs/stardoc_rule.md +++ b/docs/stardoc_rule.md @@ -20,19 +20,19 @@ This rule is an experimental replacement for the existing skylark_doc rule. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| aspect_template | The input file template for generating documentation of aspects. | Label | optional | //stardoc:templates/markdown_tables/aspect.vm | -| deps | A list of skylark_library dependencies which the input depends on. | List of labels | optional | [] | -| format | The format of the output file. Valid values: 'markdown' or 'proto'. | String | optional | "markdown" | -| func_template | The input file template for generating documentation of functions. | Label | optional | //stardoc:templates/markdown_tables/func.vm | -| header_template | The input file template for the header of the output documentation. | Label | optional | //stardoc:templates/markdown_tables/header.vm | -| input | The starlark file to generate documentation for. | Label | optional | None | -| out | The (markdown) file to which documentation will be output. | Label | required | | -| provider_template | The input file template for generating documentation of providers. | Label | optional | //stardoc:templates/markdown_tables/provider.vm | -| renderer | The location of the renderer tool. | Label | optional | //stardoc:renderer | -| rule_template | The input file template for generating documentation of rules. | Label | optional | //stardoc:templates/markdown_tables/rule.vm | -| semantic_flags | A list of canonical flags to affect Starlark semantics for the Starlark interpretter during documentation generation. This should only be used to maintain compatibility with non-default semantic flags required to use the given Starlark symbols.

For example, if //foo:bar.bzl does not build except when a user would specify --incompatible_foo_semantic=false, then this attribute should contain "--incompatible_foo_semantic=false". | List of strings | optional | [] | -| stardoc | The location of the stardoc tool. | Label | optional | //stardoc:stardoc | -| symbol_names | A list of symbol names to generate documentation for. These should correspond to the names of rule definitions in the input file. If this list is empty, then documentation for all exported rule definitions will be generated. | List of strings | optional | [] | +| name | A unique name for this target. | Name | required | | +| aspect_template | The input file template for generating documentation of aspects. | Label | optional | //stardoc:templates/markdown_tables/aspect.vm | +| deps | A list of skylark_library dependencies which the input depends on. | List of labels | optional | [] | +| format | The format of the output file. Valid values: 'markdown' or 'proto'. | String | optional | "markdown" | +| func_template | The input file template for generating documentation of functions. | Label | optional | //stardoc:templates/markdown_tables/func.vm | +| header_template | The input file template for the header of the output documentation. | Label | optional | //stardoc:templates/markdown_tables/header.vm | +| input | The starlark file to generate documentation for. | Label | optional | None | +| out | The (markdown) file to which documentation will be output. | Label | required | | +| provider_template | The input file template for generating documentation of providers. | Label | optional | //stardoc:templates/markdown_tables/provider.vm | +| renderer | The location of the renderer tool. | Label | optional | //stardoc:renderer | +| rule_template | The input file template for generating documentation of rules. | Label | optional | //stardoc:templates/markdown_tables/rule.vm | +| semantic_flags | A list of canonical flags to affect Starlark semantics for the Starlark interpretter during documentation generation. This should only be used to maintain compatibility with non-default semantic flags required to use the given Starlark symbols.

For example, if //foo:bar.bzl does not build except when a user would specify --incompatible_foo_semantic=false, then this attribute should contain "--incompatible_foo_semantic=false". | List of strings | optional | [] | +| stardoc | The location of the stardoc tool. | Label | optional | //stardoc:stardoc | +| symbol_names | A list of symbol names to generate documentation for. These should correspond to the names of rule definitions in the input file. If this list is empty, then documentation for all exported rule definitions will be generated. | List of strings | optional | [] | diff --git a/test/testdata/android_basic_test/golden.md b/test/testdata/android_basic_test/golden.md index a9ebd7bc..a62b79ef 100755 --- a/test/testdata/android_basic_test/golden.md +++ b/test/testdata/android_basic_test/golden.md @@ -15,10 +15,6 @@ This rule does android-related things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| fourth | - | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | diff --git a/test/testdata/angle_bracket_test/golden.md b/test/testdata/angle_bracket_test/golden.md index e104a423..e0b4e2e4 100755 --- a/test/testdata/angle_bracket_test/golden.md +++ b/test/testdata/angle_bracket_test/golden.md @@ -15,8 +15,8 @@ Rule with | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| useless | Args with some tags: <tag1>, <tag2> | String | optional | "Find " | +| name | A unique name for this target. | Name | required | | +| useless | Args with some tags: <tag1>, <tag2> | String | optional | "Find " | @@ -34,9 +34,9 @@ Information with | Name | Description | | :------------- | :------------- | -| foo | A string representing <foo> | -| bar | A string representing bar | -| baz | A string representing baz | +| foo | A string representing <foo> | +| bar | A string representing bar | +| baz | A string representing baz | @@ -57,6 +57,6 @@ This rule runs checks on . | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| name | an arg with **formatted** docstring. | none | +| name | an arg with **formatted** docstring. | none | diff --git a/test/testdata/apple_basic_test/golden.md b/test/testdata/apple_basic_test/golden.md index 7a8738f3..d9261a5b 100755 --- a/test/testdata/apple_basic_test/golden.md +++ b/test/testdata/apple_basic_test/golden.md @@ -15,10 +15,6 @@ This rule does apple-related things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| fourth | - | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | diff --git a/test/testdata/aspect_test/golden.md b/test/testdata/aspect_test/golden.md index 4e4f6729..f7723802 100755 --- a/test/testdata/aspect_test/golden.md +++ b/test/testdata/aspect_test/golden.md @@ -15,7 +15,6 @@ my_aspect_impl(ctx) | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| ctx |

-

| none | @@ -42,9 +41,7 @@ This is my aspect. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | @@ -70,7 +67,6 @@ This is another aspect. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| third | - | Integer | required | | +| name | A unique name for this target. | Name | required | | diff --git a/test/testdata/attribute_defaults_test/golden.md b/test/testdata/attribute_defaults_test/golden.md index 7d4e2096..baf2a0c3 100755 --- a/test/testdata/attribute_defaults_test/golden.md +++ b/test/testdata/attribute_defaults_test/golden.md @@ -15,30 +15,27 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| a | Some bool | Boolean | optional | False | -| b | Some int | Integer | optional | 2 | -| c | Some int_list | List of integers | optional | [0, 1] | -| d | Some label | Label | optional | //foo:bar | -| e | Some label_keyed_string_dict | Dictionary: Label -> String | optional | {"//foo:bar": "hello", "//bar:baz": "goodbye"} | -| f | Some label_list | List of labels | optional | ["//foo:bar", "//bar:baz"] | -| g | Some string | String | optional | "" | -| h | Some string_dict | Dictionary: String -> String | optional | {"animal": "bunny", "color": "orange"} | -| i | Some string_list | List of strings | optional | ["cat", "dog"] | -| j | Some string_list_dict | Dictionary: String -> List of strings | optional | {"animal": ["cat", "bunny"], "color": ["blue", "orange"]} | -| k | Some bool | Boolean | required | | -| l | Some int | Integer | required | | -| m | Some int_list | List of integers | required | | -| n | Some label | Label | required | | -| o | Some label_keyed_string_dict | Dictionary: Label -> String | required | | -| p | Some label_list | List of labels | required | | -| q | Some string | String | required | | -| r | Some string_dict | Dictionary: String -> String | required | | -| s | Some string_list | List of strings | required | | -| t | Some string_list_dict | Dictionary: String -> List of strings | required | | -| u | - | String | optional | "" | -| v | - | Label | optional | None | -| w | - | Integer | optional | 0 | +| name | A unique name for this target. | Name | required | | +| a | Some bool | Boolean | optional | False | +| b | Some int | Integer | optional | 2 | +| c | Some int_list | List of integers | optional | [0, 1] | +| d | Some label | Label | optional | //foo:bar | +| e | Some label_keyed_string_dict | Dictionary: Label -> String | optional | {"//foo:bar": "hello", "//bar:baz": "goodbye"} | +| f | Some label_list | List of labels | optional | ["//foo:bar", "//bar:baz"] | +| g | Some string | String | optional | "" | +| h | Some string_dict | Dictionary: String -> String | optional | {"animal": "bunny", "color": "orange"} | +| i | Some string_list | List of strings | optional | ["cat", "dog"] | +| j | Some string_list_dict | Dictionary: String -> List of strings | optional | {"animal": ["cat", "bunny"], "color": ["blue", "orange"]} | +| k | Some bool | Boolean | required | | +| l | Some int | Integer | required | | +| m | Some int_list | List of integers | required | | +| n | Some label | Label | required | | +| o | Some label_keyed_string_dict | Dictionary: Label -> String | required | | +| p | Some label_list | List of labels | required | | +| q | Some string | String | required | | +| r | Some string_dict | Dictionary: String -> String | required | | +| s | Some string_list | List of strings | required | | +| t | Some string_list_dict | Dictionary: String -> List of strings | required | | @@ -65,8 +62,7 @@ This is my aspect. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| y | some string | String | optional | "why" | -| z | - | String | required | | +| name | A unique name for this target. | Name | required | | +| y | some string | String | optional | "why" | diff --git a/test/testdata/attribute_types_test/golden.md b/test/testdata/attribute_types_test/golden.md index 7e5ae8a8..ddd30e6e 100755 --- a/test/testdata/attribute_types_test/golden.md +++ b/test/testdata/attribute_types_test/golden.md @@ -15,18 +15,18 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| a | Some bool | Boolean | required | | -| b | Some int | Integer | required | | -| c | Some int_list | List of integers | required | | -| d | Some label | Label | required | | -| e | Some label_keyed_string_dict | Dictionary: Label -> String | required | | -| f | Some label_list | List of labels | required | | -| g | Some output | Label | optional | None | -| h | Some output_list | List of labels | optional | None | -| i | Some string | String | required | | -| j | Some string_dict | Dictionary: String -> String | required | | -| k | Some string_list | List of strings | required | | -| l | Some string_list_dict | Dictionary: String -> List of strings | optional | {} | +| name | A unique name for this target. | Name | required | | +| a | Some bool | Boolean | required | | +| b | Some int | Integer | required | | +| c | Some int_list | List of integers | required | | +| d | Some label | Label | required | | +| e | Some label_keyed_string_dict | Dictionary: Label -> String | required | | +| f | Some label_list | List of labels | required | | +| g | Some output | Label | optional | None | +| h | Some output_list | List of labels | optional | None | +| i | Some string | String | required | | +| j | Some string_dict | Dictionary: String -> String | required | | +| k | Some string_list | List of strings | required | | +| l | Some string_list_dict | Dictionary: String -> List of strings | optional | {} | diff --git a/test/testdata/cc_api_test/golden.md b/test/testdata/cc_api_test/golden.md index 47c5874e..debca011 100755 --- a/test/testdata/cc_api_test/golden.md +++ b/test/testdata/cc_api_test/golden.md @@ -15,11 +15,7 @@ This rule does C++-related things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| fourth | - | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | @@ -51,6 +47,5 @@ my_rule_impl(ctx) | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| ctx |

-

| none | diff --git a/test/testdata/config_apis_test/golden.md b/test/testdata/config_apis_test/golden.md index be252d3d..3a8eb39f 100755 --- a/test/testdata/config_apis_test/golden.md +++ b/test/testdata/config_apis_test/golden.md @@ -15,7 +15,7 @@ int_setting(name) | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | +| name | A unique name for this target. | Name | required | | @@ -33,7 +33,7 @@ string_flag(name) | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | +| name | A unique name for this target. | Name | required | | @@ -65,6 +65,5 @@ A no-op transition function. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| settings |

-

| none | diff --git a/test/testdata/cpp_basic_test/golden.md b/test/testdata/cpp_basic_test/golden.md index fcc33009..4dc5d074 100755 --- a/test/testdata/cpp_basic_test/golden.md +++ b/test/testdata/cpp_basic_test/golden.md @@ -15,10 +15,6 @@ This rule does cpp-related things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| fourth | - | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | diff --git a/test/testdata/filter_rules_test/golden.md b/test/testdata/filter_rules_test/golden.md index dfe33e30..bc8eb9f1 100755 --- a/test/testdata/filter_rules_test/golden.md +++ b/test/testdata/filter_rules_test/golden.md @@ -15,9 +15,8 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | first my_rule doc string | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | +| first | first my_rule doc string | Label | required | | @@ -35,8 +34,7 @@ This is the dep rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | dep's my_rule doc string | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | +| first | dep's my_rule doc string | Label | required | | diff --git a/test/testdata/function_basic_test/golden.md b/test/testdata/function_basic_test/golden.md index dd6fba7e..a902f229 100755 --- a/test/testdata/function_basic_test/golden.md +++ b/test/testdata/function_basic_test/golden.md @@ -20,14 +20,10 @@ Use `bazel build` to run the check. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| name | A unique name for this rule. | none | -| required_param | Use your imagination. | none | -| bool_param |

-

| True | -| srcs | Source files to run the checks against. | [] | -| string_param |

-

| "" | -| int_param | Your favorite number. | 2 | -| dict_param |

-

| {} | -| struct_param |

-

| struct(foo = "bar") | +| name | A unique name for this rule. | none | +| required_param | Use your imagination. | none | +| srcs | Source files to run the checks against. | [] | +| int_param | Your favorite number. | 2 | @@ -45,8 +41,5 @@ undocumented_function(a, a |

-

| none | -| b |

-

| none | -| c |

-

| none | diff --git a/test/testdata/generated_bzl_test/golden.md b/test/testdata/generated_bzl_test/golden.md index 423cebf0..e825b814 100755 --- a/test/testdata/generated_bzl_test/golden.md +++ b/test/testdata/generated_bzl_test/golden.md @@ -15,8 +15,7 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | first my_rule doc string | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | +| first | first my_rule doc string | Label | required | | diff --git a/test/testdata/java_basic_test/golden.md b/test/testdata/java_basic_test/golden.md index aaea51d7..75bdf61a 100755 --- a/test/testdata/java_basic_test/golden.md +++ b/test/testdata/java_basic_test/golden.md @@ -15,10 +15,6 @@ This rule does java-related things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| fourth | - | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | diff --git a/test/testdata/local_repository_test/golden.md b/test/testdata/local_repository_test/golden.md index 27bc8144..bde70d31 100755 --- a/test/testdata/local_repository_test/golden.md +++ b/test/testdata/local_repository_test/golden.md @@ -15,6 +15,6 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers | A list of integers. Must not be empty. | none | +| integers | A list of integers. Must not be empty. | none | diff --git a/test/testdata/macro_kwargs_test/golden.md b/test/testdata/macro_kwargs_test/golden.md index b89998ed..8f20821a 100755 --- a/test/testdata/macro_kwargs_test/golden.md +++ b/test/testdata/macro_kwargs_test/golden.md @@ -15,8 +15,8 @@ My args macro is OK. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| name | The name of the test rule. | none | -| args | Other arguments to include | none | +| name | The name of the test rule. | none | +| args | Other arguments to include | none | @@ -37,10 +37,10 @@ Not much else to say. | 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 | +| 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 | @@ -65,9 +65,9 @@ vel mollis eros pellentesque. | 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 | +| 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 | diff --git a/test/testdata/misc_apis_test/golden.md b/test/testdata/misc_apis_test/golden.md index 096ccc13..654d9667 100755 --- a/test/testdata/misc_apis_test/golden.md +++ b/test/testdata/misc_apis_test/golden.md @@ -15,12 +15,11 @@ This rule exercises some of the build API. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| deps | A list of dependencies. | List of labels | optional | [] | -| extra_arguments | - | List of strings | optional | [] | -| out | The output file. | Label | required | | -| src | The source file. | Label | optional | None | -| tool | The location of the tool to use. | Label | optional | //foo/bar/baz:target | +| name | A unique name for this target. | Name | required | | +| deps | A list of dependencies. | List of labels | optional | [] | +| out | The output file. | Label | required | | +| src | The source file. | Label | optional | None | +| tool | The location of the tool to use. | Label | optional | //foo/bar/baz:target | @@ -38,8 +37,8 @@ MyInfo(foo, bar) | Name | Description | | :------------- | :------------- | -| foo | Something foo-related. | -| bar | Something bar-related. | +| foo | Something foo-related. | +| bar | Something bar-related. | @@ -71,6 +70,5 @@ my_rule_impl(ctx) | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| ctx |

-

| none | diff --git a/test/testdata/multi_level_namespace_test/golden.md b/test/testdata/multi_level_namespace_test/golden.md index e93ad657..85fdd94c 100755 --- a/test/testdata/multi_level_namespace_test/golden.md +++ b/test/testdata/multi_level_namespace_test/golden.md @@ -15,7 +15,7 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers | A list of integers. Must not be empty. | none | +| integers | A list of integers. Must not be empty. | none | @@ -33,7 +33,7 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers | A list of integers. Must not be empty. | none | +| integers | A list of integers. Must not be empty. | none | @@ -65,7 +65,7 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers | A list of integers. Must not be empty. | none | +| integers | A list of integers. Must not be empty. | none | diff --git a/test/testdata/multi_level_namespace_test_with_whitelist/golden.md b/test/testdata/multi_level_namespace_test_with_whitelist/golden.md index 730a281d..ea4c9095 100644 --- a/test/testdata/multi_level_namespace_test_with_whitelist/golden.md +++ b/test/testdata/multi_level_namespace_test_with_whitelist/golden.md @@ -15,7 +15,6 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers |

-

| none | @@ -33,7 +32,6 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers |

-

| none | diff --git a/test/testdata/multiple_files_test/golden.md b/test/testdata/multiple_files_test/golden.md index d21397a4..a282715a 100755 --- a/test/testdata/multiple_files_test/golden.md +++ b/test/testdata/multiple_files_test/golden.md @@ -15,9 +15,8 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | first my_rule doc string | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | +| first | first my_rule doc string | Label | required | | @@ -35,9 +34,8 @@ This is another rule. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| fourth | - | Dictionary: String -> String | required | | -| third | third other_rule doc string | Label | required | | +| name | A unique name for this target. | Name | required | | +| third | third other_rule doc string | Label | required | | @@ -55,8 +53,7 @@ This is yet another rule | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| fifth | - | Label | required | | +| name | A unique name for this target. | Name | required | | @@ -74,8 +71,5 @@ top_fun(a, b, a |

-

| none | -| b |

-

| none | -| c |

-

| none | diff --git a/test/testdata/multiple_rules_test/golden.md b/test/testdata/multiple_rules_test/golden.md index aacaa50c..c11fea9a 100755 --- a/test/testdata/multiple_rules_test/golden.md +++ b/test/testdata/multiple_rules_test/golden.md @@ -15,9 +15,7 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | - | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | @@ -35,9 +33,7 @@ This is another rule. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| fourth | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | @@ -55,8 +51,7 @@ This is yet another rule | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| fifth | - | Label | required | | +| name | A unique name for this target. | Name | required | | @@ -74,6 +69,5 @@ my_rule_impl(ctx) | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| ctx |

-

| none | diff --git a/test/testdata/namespace_test/golden.md b/test/testdata/namespace_test/golden.md index 678499eb..e9cc7648 100755 --- a/test/testdata/namespace_test/golden.md +++ b/test/testdata/namespace_test/golden.md @@ -15,8 +15,8 @@ Asserts the two given lists are not empty. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| some_list | The first list | none | -| other_list | The second list | none | +| some_list | The first list | none | +| other_list | The second list | none | @@ -34,7 +34,7 @@ Returns the minimum of given elements. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| integers | A list of integers. Must not be empty. | none | +| integers | A list of integers. Must not be empty. | none | @@ -52,7 +52,7 @@ Joins the given strings with a delimiter. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| strings | A list of strings to join. | none | -| delimiter | The delimiter to use | ", " | +| strings | A list of strings to join. | none | +| delimiter | The delimiter to use | ", " | diff --git a/test/testdata/provider_basic_test/golden.md b/test/testdata/provider_basic_test/golden.md index 5287efb5..517faa4a 100755 --- a/test/testdata/provider_basic_test/golden.md +++ b/test/testdata/provider_basic_test/golden.md @@ -15,8 +15,8 @@ Stores information about a foo. | Name | Description | | :------------- | :------------- | -| bar | (Undocumented) | -| baz | (Undocumented) | +| bar | (Undocumented) | +| baz | (Undocumented) | @@ -51,7 +51,7 @@ Look on my works, ye mighty, and despair! | Name | Description | | :------------- | :------------- | -| favorite_food | A string representing my favorite food | -| favorite_color | A string representing my favorite color | +| favorite_food | A string representing my favorite food | +| favorite_color | A string representing my favorite color | diff --git a/test/testdata/providers_for_attributes_test/golden.md b/test/testdata/providers_for_attributes_test/golden.md index 8c4ef73e..6e07927e 100755 --- a/test/testdata/providers_for_attributes_test/golden.md +++ b/test/testdata/providers_for_attributes_test/golden.md @@ -15,13 +15,8 @@ This rule does things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| fifth | - | Label | optional | None | -| first | this is the first attribute. | Dictionary: Label -> String | optional | {} | -| fourth | - | Label | optional | None | -| second | - | List of labels | optional | [] | -| sixth | - | Label | optional | None | -| third | - | Label | optional | None | +| name | A unique name for this target. | Name | required | | +| first | this is the first attribute. | Dictionary: Label -> String | optional | {} | @@ -39,8 +34,8 @@ MyProviderInfo(foo, foo | Something foo-related. | -| bar | Something bar-related. | +| foo | Something foo-related. | +| bar | Something bar-related. | @@ -72,6 +67,5 @@ my_rule_impl(ctx) | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| ctx |

-

| none | diff --git a/test/testdata/py_rule_test/golden.md b/test/testdata/py_rule_test/golden.md index b8f416d4..5871860e 100755 --- a/test/testdata/py_rule_test/golden.md +++ b/test/testdata/py_rule_test/golden.md @@ -15,12 +15,10 @@ This rule does python-related things. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| fifth | Hey look, its the fifth thing! | Boolean | optional | True | -| first | this is the first doc string! | Label | required | | -| fourth | the fourth doc string. | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| sixth | it's the sixth thing. | List of integers | optional | range(0, 10) | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | +| fifth | Hey look, its the fifth thing! | Boolean | optional | True | +| first | this is the first doc string! | Label | required | | +| fourth | the fourth doc string. | Boolean | optional | False | +| sixth | it's the sixth thing. | List of integers | optional | range(0, 10) | diff --git a/test/testdata/repo_rules_test/golden.md b/test/testdata/repo_rules_test/golden.md index a0ac59b4..c3447789 100755 --- a/test/testdata/repo_rules_test/golden.md +++ b/test/testdata/repo_rules_test/golden.md @@ -15,7 +15,7 @@ Minimal example of a repository rule. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this repository. | Name | required | | -| useless | This argument will be ingored. You don't have to specify it, but you may. | String | optional | "ignoreme" | +| name | A unique name for this repository. | Name | required | | +| useless | This argument will be ingored. You don't have to specify it, but you may. | String | optional | "ignoreme" | diff --git a/test/testdata/same_level_file_test/golden.md b/test/testdata/same_level_file_test/golden.md index 423cebf0..e825b814 100755 --- a/test/testdata/same_level_file_test/golden.md +++ b/test/testdata/same_level_file_test/golden.md @@ -15,8 +15,7 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | first my_rule doc string | Label | required | | -| second | - | Dictionary: String -> String | required | | +| name | A unique name for this target. | Name | required | | +| first | first my_rule doc string | Label | required | | diff --git a/test/testdata/simple_test/golden.md b/test/testdata/simple_test/golden.md index 9002be92..264f2920 100755 --- a/test/testdata/simple_test/golden.md +++ b/test/testdata/simple_test/golden.md @@ -15,10 +15,8 @@ This is my rule. It does stuff. | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | -| name | A unique name for this target. | Name | required | | -| first | first doc string | Label | required | | -| fourth | fourth doc string | Boolean | optional | False | -| second | - | Dictionary: String -> String | required | | -| third | - | Label | required | | +| name | A unique name for this target. | Name | required | | +| first | first doc string | Label | required | | +| fourth | fourth doc string | Boolean | optional | False | diff --git a/test/testdata/struct_default_value_test/golden.md b/test/testdata/struct_default_value_test/golden.md index 60c6be0d..bd56523a 100755 --- a/test/testdata/struct_default_value_test/golden.md +++ b/test/testdata/struct_default_value_test/golden.md @@ -16,10 +16,10 @@ Checks the default values of structs. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| struct_no_args | struct with no arguments | struct() | -| struct_arg | struct with one argument | struct(foo = "bar") | -| struct_args | struct with multiple arguments | struct(bar = "foo", foo = "bar") | -| struct_int_args | struct with int arguments | struct(one = 1, three = 3, two = 2) | -| struct_struct_args | struct with struct arguments | struct(multiple = struct(one = 1, three = 3, two = 2), none = struct(), one = struct(foo = "bar")) | +| struct_no_args | struct with no arguments | struct() | +| struct_arg | struct with one argument | struct(foo = "bar") | +| struct_args | struct with multiple arguments | struct(bar = "foo", foo = "bar") | +| struct_int_args | struct with int arguments | struct(one = 1, three = 3, two = 2) | +| struct_struct_args | struct with struct arguments | struct(multiple = struct(one = 1, three = 3, two = 2), none = struct(), one = struct(foo = "bar")) | diff --git a/test/testdata/unknown_name_test/golden.md b/test/testdata/unknown_name_test/golden.md index 4bd6f92c..bb926209 100755 --- a/test/testdata/unknown_name_test/golden.md +++ b/test/testdata/unknown_name_test/golden.md @@ -15,6 +15,5 @@ my_rule_impl(ctx) | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| ctx |

-

| none |