Skip to content

Support type annotations #900

@ndmitchell

Description

@ndmitchell

The code:

def foo(x: 1):
    pass

Currently gives:

$ buildifier foo.bzl
foo.bzl:1:11: syntax error near :

That code is accepted by python3. I think it would be useful to support in buildifer in particular because types are an extension that some Starlark implementations support, much the same way that nested-def is a Starlark extension that is supported by buildifier.

If the above is accepted, I'd be happy to do a PR to enable it.

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