bazel-contrib / bazel-contrib/buildtools

[buildifier] Warn (and exit nonzero) if `--lint=fix` and there are unfixable lints

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

Description

Unfortunately, because `-lint=fix` exits zero (even if there are unfixable errors), that means I don't have any confidence that `-lint=fix` doesn't require a subsequent `-lint=warn` (which means I'm having to run `buildifier` twice.

Ideally, `-lint=fix` would:
- Fix fixable lints
- Warn/exit nonzero the non-fixable ones

(Alternatively could be a new `lint` value like `fix-and-warn`)

Contributor guide

Open the contributing guide

Research direction

Start by locating buildifier's handling of the --lint=fix option and its existing lint-related tests. Run those tests to understand current exit behavior; done means fixable lints are corrected while unfixable lints are reported and cause a nonzero exit.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.