aboutsummaryrefslogtreecommitdiff
path: root/test/testdata/function_basic_test/input.bzl
blob: 2d75025c4674bb858a208e4ccc6eea104e11ac2c (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""A test that verifies basic user function documentation."""

def check_sources(
        name,
        required_param,
        bool_param = True,
        srcs = [],
        string_param = "",
        int_param = 2,
        dict_param = {},
        struct_param = struct(foo = "bar")):
    # buildifier: disable=function-docstring-args
    """Runs some checks on the given source files.

    This rule runs checks on a given set of source files.
    Use `bazel build` to run the check.

    Args:
        name: A unique name for this rule.
        required_param: Use your imagination.
        srcs: Source files to run the checks against.
        doesnt_exist: A param that doesn't exist (lets hope we still get *some* documentation)
        int_param: Your favorite number.
    """
    _ignore = [
        name,
        required_param,
        bool_param,
        srcs,
        string_param,
        int_param,
        dict_param,
        struct_param,
    ]  # @unused
    x = ("Hah. All that documentation but nothing really to see here")  # @unused

def returns_a_thing(name):
    """Returns a suffixed name.

    Args:
        name: A unique name for this rule.

    Returns:
        A suffixed version of the name.
    """
    _ignore = name  # @unused
    pass

def deprecated_do_not_use():
    """This function is deprecated.

    Deprecated:
        Use literally anything but this function.
    """
    pass

# buildifier: disable=unused-variable
def undocumented_function(a, b, c):
    pass

# buildifier: disable=unused-variable
def param_doc_multiline(complex):
    """Has a complex parameter.

    Args:
        complex: A parameter with some non-obvious behavior.

            For example, it does things that require **multiple paragraphs** to explain.

           Note: we should preserve the nested indent in the following code:

           ```json
           {
               "key": "value"
           }
           ```
    """
    pass