Skip to content

Support inline type annotations #1381

@lf-

Description

@lf-

With #900, buildtools gained the ability to parse type annotations on parameters and return types, but it didn't add inline type annotations.

def _collect_nix_deps(ctx: bxl.Context):
    target = ctx.cli_args.target
    # TODO: is this platform name required?
    cquery: bxl.CqueryContext = ctx.cquery("prelude//platforms:default")

The above is accepted by buck2 in a BXL context at least (and I would assume also other contexts) and is rejected by buildifier -type default:

snowydeer/snowydeer.bxl:46:12: syntax error near :
snowydeer/snowydeer.bxl # reformat

cc @ndmitchell as original issue author

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions