xref: /aosp_15_r20/external/stardoc/test/testdata/function_basic_test/input.bzl (revision b2fa42943c124aa9c7163734493fc7a7559681cf)
1"""A test that verifies basic user function documentation."""
2
3def check_sources(
4        name,
5        required_param,
6        bool_param = True,
7        srcs = [],
8        string_param = "",
9        int_param = 2,
10        dict_param = {},
11        struct_param = struct(foo = "bar")):
12    # buildifier: disable=function-docstring-args
13    """Runs some checks on the given source files.
14
15    This rule runs checks on a given set of source files.
16    Use `bazel build` to run the check.
17
18    Args:
19        name: A unique name for this rule.
20        required_param: Use your imagination.
21        srcs: Source files to run the checks against.
22        doesnt_exist: A param that doesn't exist (lets hope we still get *some* documentation)
23        int_param: Your favorite number.
24    """
25    _ignore = [
26        name,
27        required_param,
28        bool_param,
29        srcs,
30        string_param,
31        int_param,
32        dict_param,
33        struct_param,
34    ]  # @unused
35    x = ("Hah. All that documentation but nothing really to see here")  # @unused
36
37def returns_a_thing(name):
38    """Returns a suffixed name.
39
40    Args:
41        name: A unique name for this rule.
42
43    Returns:
44        A suffixed version of the name.
45    """
46    _ignore = name  # @unused
47    pass
48
49def deprecated_do_not_use():
50    """This function is deprecated.
51
52    Deprecated:
53        Use literally anything but this function.
54    """
55    pass
56
57def undocumented_function(a, b, c):
58    _ignore = [a, b, c]  # @unused
59    pass
60