bazel-contrib / bazel-contrib/buildtools

buildifier_test does not complain when passix fix as a mode

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

Description

When passing fix to the lint_mode or mode to buildifier_test, Bazel does not complain.
This is not nice from a user point of view.

```
buildifier_test(
name = "buildifier",
size = "small",
timeout = "short",
lint_mode = "fix",
mode = "fix",
no_sandbox = True,
workspace = "//:WORKSPACE",
)
```

I tried with buildtools 6.4.0 and Bazel 7.0.0

Contributor guide

Open the contributing guide

Research direction

Start with the buildifier_test rule and reproduce the issue using the provided BUILD snippet with buildtools 6.4.0 and Bazel 7.0.0. Trace how lint_mode and mode are validated; done means passing "fix" causes Bazel to report a configuration error instead of being accepted.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.