bazel-contrib / bazel-contrib/buildtools

Feature request: buildifier diff mode that would show changes applied by --lint=fix

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

Description

It would be great to have some way be able to run `buildifier` with `--mode=diff` which takes into account the diffs that would be applied by `--lint=fix`.

This would be useful for having a CI check that makes sure `buildifier --lint=fix ...` is run before code can be merged. Currently, this can only be done by actually running `buildifier --lint=fix` and then running `git diff` to see if there were any changes, but this is not ideal because it touches the working tree.

Contributor guide

Open the contributing guide

Research direction

Start at the buildifier command-line handling for --mode and --lint=fix, then trace how the formatter currently applies fixes. Compare the proposed --mode=diff behavior with the existing workflow of running buildifier and git diff. Done means CI can show whether --lint=fix would change files without touching the working tree.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.