1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
"""Input file for markdown template test"""
def example_function(foo, bar = "bar"):
"""Small example of function using a markdown template.
Args:
foo: This parameter does foo related things.
bar: This parameter does bar related things.
"""
_ignore = [foo, bar] # @unused
pass
# buildifier: disable=unsorted-dict-items
ExampleProviderInfo = provider(
doc = "Small example of provider using a markdown template.",
fields = {
"foo": "A string representing foo",
"bar": "A string representing bar",
"baz": "A string representing baz",
},
)
def _rule_impl(ctx):
_ignore = [ctx] # @unused
return []
example_rule = rule(
implementation = _rule_impl,
doc = "Small example of rule using a markdown template.",
attrs = {
"first": attr.string(doc = "This is the first attribute"),
"second": attr.string(default = "2"),
},
)
def _aspect_impl(ctx):
_ignore = [ctx] # @unused
return []
example_aspect = aspect(
implementation = _aspect_impl,
doc = "Small example of aspect using a markdown template.",
attr_aspects = ["deps", "attr_aspect"],
attrs = {
"first": attr.label(mandatory = True, allow_single_file = True),
"second": attr.string(doc = "This is the second attribute."),
},
)
|