bazel-contrib / bazel-contrib/buildtools
fix silently fails to fix
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 471
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 13
Description
-lint=fix doesn't fix an unused-variable silently leaving the impression there are no problems. If it fails it should print the lint=warn message.
Very trivial test case:
```
ALL_TESTS2 = COMPULSORY_TESTS
```
```
% buildifier --lint=warn BUILD
BUILD:1: unused-variable: Variable "ALL_TESTS2" is unused. Please remove it. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unused-variable)
% buildifier --lint=fix BUILD
% buildifier --lint=warn BUILD
BUILD:1: unused-variable: Variable "ALL_TESTS2" is unused. Please remove it. (https://github.com/bazelbuild/buildtools/blob/main/WARNINGS.md#unused-variable)
```
Contributor guide
Research direction
Reproduce the behavior with the provided BUILD file and the buildifier commands using --lint=warn and --lint=fix. Trace the buildifier lint=fix entry point and compare its handling of the unused-variable case with lint=warn; done means the fix attempt reports the warning when the issue remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system, cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100