# Buildifier

[**Buildifier**](https://github.com/rhysd/actionlint) is a linter for Bazel, Starlark.

You can enable the Buildifier linter with:

```shell
trunk check enable buildifier
```

![buildifier example output](https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-525e94d479e0123070c01b065d00fa7b3680c8e8%2Fbuildifier.gif?alt=media)

## Auto Enabling

Buildifier will be auto-enabled if any *Bazel or Starlark* files are present.

## Settings

Buildifier supports the following config files:

* `.buildifier.json`
* `.buildifier-tables.json`

You can move these files to `.trunk/configs` and `trunk check` will still find them. See [Moving Linters](https://docs.trunk.io/code-quality/overview/configure-linters#moving-linters) for more info.

## Links

* [Buildifier site](https://github.com/rhysd/actionlint)
* Buildifier Trunk Code Quality [integration source](https://github.com/trunk-io/plugins/tree/main/linters/buildifier)
* Trunk Code Quality's [open source plugins repo](https://github.com/trunk-io/plugins/tree/main)
