Skip to content

Buildifier does not support f-strings #1278

Description

@cbarrete

Buck2 supports f-string (although Bazel does not, at least yet), so it would be nice if buildifier did not consider them invalid syntax.

Currently, running it over:

name = "Cédric"
print(f"Hello, {name}!")

gives

> buildifier asdf.bzl
asdf.bzl:2:24: syntax error near "Hello, {name}!"
asdf.bzl # reformat

It seems like this could be implemented quite easily similarly to raw strings, is this correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3We're not considering working on this, but happy to review a PR. (No assignee)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions