Visitar URL original
buildifier Plugin - dprint - Code Formatter
// plugins

buildifier

buildifier (Bazel/Starlark) wrapper plugin.

Wrapper plugin that formats Bazel and Starlark files via buildifier. It runs buildifier's own code compiled to Wasm, so it formats like the buildifier CLI.

Formats BUILD, BUILD.bazel, MODULE.bazel, WORKSPACE, WORKSPACE.bazel, WORKSPACE.bzlmod, REPO.bazel and VENDOR.bazel files as Bazel files, and .bzl, .star and .sky files as plain Starlark. Like buildifier, it picks how to format a file from its name.

Install and Setup

In your project's directory with a dprint.json file, run:

dprint add buildifier

This will update your config file to have an entry for the plugin. Then optionally specify a "buildifier" property to add configuration:

{
  "buildifier": {
    // buildifier's config goes here
  },
  "plugins": [
    "npm:@dprint/buildifier@0.3.0"
  ]
}

Configuration

buildifier has no style options, so the only option is newLineKind.

All plugins

Official Plugins

Community Plugins

Wrapper Plugins

Everything Else