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