1# buildifier: disable=module-docstring 2def my_rule_impl(ctx): 3 return [] 4 5my_rule = rule( 6 implementation = my_rule_impl, 7 doc = "This is my rule. It does stuff.", 8 attrs = { 9 "first": attr.label(mandatory = True, allow_single_file = True), 10 "second": attr.string_dict(mandatory = True), 11 }, 12) 13 14other_rule = rule( 15 implementation = my_rule_impl, 16 doc = "This is another rule.", 17 attrs = { 18 "third": attr.label(mandatory = True, allow_single_file = True), 19 "_hidden": attr.string(), 20 "fourth": attr.string_dict(mandatory = True), 21 }, 22) 23 24yet_another_rule = rule( 25 implementation = my_rule_impl, 26 doc = "This is yet another rule", 27 attrs = { 28 "_hidden": attr.string(), 29 "fifth": attr.label(mandatory = True, allow_single_file = True), 30 }, 31) 32