bazel-contrib / bazel-contrib/buildtools

buildifier does not move package() to the top in some cases

Open
#1,420 4 comments 0 reactions 0 assignees View on GitHub
P3
Dominant language
Go
Stars
1.2k
Forks
471
Avg merge
2d 22h
Merged PRs (30d)
13

Description

if you have a BUILD file like this:

```bzl
some_target(
...
)

some_list = [
#
]

package(default_visibility = ["//visibility:public"])
```

buildifier does not warn about the package() being at the bottom, nor does it move it to the top when fixing

Contributor guide

Open the contributing guide

Research direction

Start by running buildifier on the provided BUILD file, with package() after a target and list, and compare checking with fixing. Trace the package-ordering behavior from the buildifier entry point. Done means buildifier warns about the misplaced package() call and moves it to the top when fixing.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.