Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 786 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 786 Bytes

pre-commit-buildifier-docker

A pre-commit hook that runs buildifier via Docker. This formats Bazel's BUILD, WORKSPACE, and *.bzl files.

pre-commit supports multiple ways to implement hooks. Since buildifier is written in Go and integrated with Bazel, it could have used golang, system (and run bazel run //:buildifier), docker, and docker_image. This hook uses docker. This is beneficial for the situation where (1) you cannot expect the Go runtime being installed on the system and (2) you want to avoid running Bazel because it cannot concurrently run two invocations. Since there's no existing Docker image for buildifier, this uses docker instead of docker_image.