Skip to content

[buildifier] --lint=warn --warnings=-unsorted-dict-items is still fixing unsorted-dict-items #1392

@nickdesaulniers

Description

@nickdesaulniers
$ ./buildifier-linux-amd64 --lint=warn --warnings=all common/external/BUILD.bazel
common/external/BUILD.bazel:13: unsorted-dict-items: Dictionary items are out of their lexicographical order. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unsorted-dict-items)
common/external/BUILD.bazel:15: unsorted-dict-items: Dictionary items are out of their lexicographical order. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unsorted-dict-items)
common/external/BUILD.bazel:17: unsorted-dict-items: Dictionary items are out of their lexicographical order. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unsorted-dict-items)

$ git reset --hard
$ ./buildifier-linux-amd64 --lint=warn --warnings=-unsorted-dict-items common/external/BUILD.bazel
$ git diff
<common/external/BUILD.bazel has dict items sorted>

!!!

I did not pass --lint=fix, so it's surprising this was fixed, doubly so since I disabled warning on unsorted-dict-items. How do I disable automatically fixing unsorted-dict-items? Perhaps https://github.com/bazelbuild/buildtools/tree/main/buildifier#linter needs an update.

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