1"""Input file for input template test""" 2 3def template_function(foo): 4 """Runs some checks on the given function parameter. 5 6 This rule runs checks on a given function parameter in chosen template. 7 Use `bazel build` to run the check. 8 9 Args: 10 foo: A unique name for this function. 11 """ 12 pass 13 14example = provider( 15 doc = "Stores information about an example in chosen template.", 16 fields = { 17 "foo": "A string representing foo", 18 "bar": "A string representing bar", 19 "baz": "A string representing baz", 20 }, 21) 22 23def _rule_impl(ctx): 24 return [] 25 26my_example = rule( 27 implementation = _rule_impl, 28 doc = "Small example of rule using chosen template.", 29 attrs = { 30 "useless": attr.string( 31 doc = "This argument will be ignored.", 32 default = "word", 33 ), 34 }, 35) 36 37def my_aspect_impl(ctx): 38 return [] 39 40my_aspect = aspect( 41 implementation = my_aspect_impl, 42 doc = "This is my aspect. It does stuff.", 43 attr_aspects = ["deps", "attr_aspect"], 44 attrs = { 45 "first": attr.label(mandatory = True, allow_single_file = True), 46 }, 47) 48