intended behavior of movePackageToTop
The implementation of fix movePackageToTop has a comment that suggests it will make the package( call the first statement after any comments: https://github.com/bazelbuild/buildtools/blob/b1667ff58f714d13c2bba6823d6c52214705508f/edit/fix.go#L401-L403
However, the implementation will put the package declaration after loads, assignments, and docstrings in addition to comments. Which is the intended behavior?
(FWIW, the fact that movePackageToTop won't lift the package declaration above load statements makes the replace_load buildozer command less useful.)
The comment is outdated, by convention docstrings and load statements should be on the top. Buildifier's linter warns if a file has a package() statement before a load().
Why does it make the replace_load command less useful?
I see. For some reason I thought that package() should always be the first statement, so I was confused when replace_load followed by movePackageToTop didn't put the package above the new load.