[buildifier] Preserve symbol semantics when removing unused loads. (#433)
When the same symbol is loaded multiple times, during evalution the
last symbol wins and all previous loads are ignored, but `buildifier`
would preserve the first instance and remove all other usages
which breaks semantics unless all loads are from the same file.
In other words
```
load(":defs1.bzl", "s1")
load(":defs2.bzl", "s1")
```
is equivalent to
```
load(":defs2.bzl", "s1")
```
but `buildifier` would produce
```
load(":defs1.bzl", "s1")
```
To address this, all statements are analyzed in a reverse order, so the very
last (in terms of line numbers) is preserved and all preceding loads are
removed. This also slightly simplifies `load` removal logic, since we no longer
need to adjust index.This repository contains developer tools for working with Google's bazel buildtool.
See instructions in each tool's directory.