Skip to content

[buildifier] Proper handling of scientific notation in arguments #1401

@jakeBass

Description

@jakeBass

Currently,

tolerance = 5e-3

gets formatted to

tolerance = 5e - 3

as if the numbers were being subtracted. This is less clear than keeping the characters all adjacent to each other.

To reproduce the issue, clone the repo. Then run:

$ echo 'filegroup(name="foo", tolerance = 5e-3)' > BUILD.bazel
$ cat BUILD.bazel
filegroup(name="foo", tolerance = 5e-3)
$ buildifier BUILD.bazel
$ cat BUILD.bazel
filegroup(
    name = "foo",
    tolerance = 5e - 3,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions