Open chulkilee opened 2 months ago
It was definitely correct at one point, but it looks like the addition of @@
with bzlmod support broke it.
If you're able, can you figure out if @@
always comes after @
according to buildifier, or if all of the lines are ordered by their repo names?
I.e., should it be
load("@@bar//:bar.bzl", "bar")
load("@foo//:foo.bzl", "foo")
load("@@qux//:qux.bzl", "qux")
or
load("@foo//:foo.bzl", "foo")
load("@@bar//:bar.bzl", "bar")
load("@@qux//:qux.bzl", "qux")
I just tested, and it's the first way. buildifier
seems to order them by repo name, not by the label string.
The generated load is out of order for buildifier
Generated:
Formatted:
One option is to add
# buildifier: disable=out-of-order-load
. However it seems like it tries to put that in order on purpose ("# External repo loads come before local loads." - but I'm wondering if it's even necessary to keep the order, as buildifier suggested to reorder it.https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#load-statements-should-be-ordered-by-their-labels