bazelbuild / buildtools

A bazel BUILD file formatter and editor
Apache License 2.0
994 stars 410 forks source link

buildifier destroys `load()` statements targeting the same name #1241

Closed zsol closed 4 months ago

zsol commented 4 months ago
load("//:one.bzl", one_thing = "thing")
load("//:two.bzl", two_thing = "thing")

This is perfectly legit code that loads the same name from two different files and aliases them to different symbols. Buildifier insists on removing one of these load() statements. I think this is a bug in buildifier.

vladmos commented 4 months ago

I can't reproduce the issue, i.e. running buildifier --lint=warn on the file above only complains that the loaded symbols are unused, and if I make them used the warning disappears. What's the version of buildifier you're using and how do you reproduce the issue?

zsol commented 4 months ago

Sorry for the noise, I can't reproduce this either with latest buildifier.