buck2 icon indicating copy to clipboard operation
buck2 copied to clipboard

docs generator: attrs.source() becomes `str` which is unhelpful

Open lf- opened this issue 4 months ago • 0 comments

Synopsis: There are many different types of str that can be used in rules that have significant semantic meaning: sources, target selectors, and more. However, they're squashed into str at docs generation time, which is frustrating as a user, especially if the attrs in question are undocumented (something which needs improvement in the prelude overall).

Definition: https://github.com/facebook/buck2/blob/425b675fe04fe923dbaed0de85ee863fab3bd3dc/prelude/decls/core_rules.bzl#L206

Result:

def command_alias(
    *,
    # ...
    platform_exe: dict[str, str] = {},
    resources: list[str] = [],
    # ...
) -> None

Web version: https://buck2.build/docs/prelude/rules/core/command_alias/

lf- avatar Aug 22 '25 17:08 lf-