aspect buildifier formats Starlark files — BUILD, BUILD.bazel, MODULE.bazel, .bzl, .axl, WORKSPACE, and more — using the buildifier binary from buildifier_prebuilt.
It is currently registered as an alias of aspect format via format.alias() in .aspect/config.axl. This makes it a first-class CLI command without any BUILD target or rules_lint dependency — just a bazel_dep on buildifier_prebuilt and a few lines of AXL.
Under the hood, aspect buildifier runs through the same aspect format infrastructure: the same change-detection logic, the same git snapshot technique, the same --on-change behavior, and the same artifact upload. The only difference is the formatter binary and the file pattern filter.
The alias setup below is the supported configuration today. A future release of the Aspect CLI may ship
aspect buildifier as a built-in task that requires no format.alias() block — at which point the alias becomes optional. For now, follow the setup below.Setup
MODULE.bazel:
.aspect/config.axl:
aspect buildifier as a real CLI command. Run it locally:
Configuration
All aspect format configuration applies:--scope, --on-change, --ignore-pattern, --upload-format-diff. The format.alias() defaults bake in the formatter target and file patterns so you don’t repeat them at invocation time.
To add or remove file patterns from the defaults:
.aspect/config.axl
CI examples
The--task:name matches the alias name you registered:

