Buildifier
latest 10.2.0_20261028Formatter and linter for Bazel BUILD, WORKSPACE, and .bzl files — the standard code style for Bazel's Starlark dialect
Versions · 70
click = copy identifier · right-click = more- yanked — ·
- yanked — ·
README
Buildifier
Buildifier formats and lints Bazel BUILD, WORKSPACE, and .bzl files to a
standard style, the way gofmt does for Go — anyone maintaining a Bazel
workspace wants it in their pre-commit hook or CI so generated and
hand-written BUILD files never drift apart.
It reads Starlark source (BUILD/BUILD.bazel, WORKSPACE, .bzl,
MODULE.bazel) and either rewrites the file in place or reports a
diagnostic, depending on the flags passed.
What's included
- buildifier — the single static binary. No runtime dependencies.
Usage
buildifier -r .
Reformats every BUILD/WORKSPACE/.bzl file under the current directory in
place. Run with --lint=warn to report style issues without rewriting, or
--mode=check --format=json to fail a CI step non-destructively.
Buildifier ships from the same repository and release as buildozer and
unused-deps — if you need one, the other two are one ocx add away.
Links
Apache-2.0 licensed.
Install
Platforms
Support matrix
Which platforms each version ships for. Click a version to copy its identifier.
No version supports all the chosen platforms.
The versions could not be loaded.
No platforms listed.