dprint-plugin-goat provides five formatter plugins for dprint: one for Go files using Go's canonical formatter, one for shell scripts using shfmt, one for Terraform/HCL files using HashiCorp's hclwrite, one for CUE files using the official CUE formatter, and one for Protobuf files using a Buf-compatible formatter. All are compiled to WebAssembly with TinyGo and plug into dprint like any other plugin.
Using dprint plugins lets you keep a single, consistent formatting workflow across polyglot repos. The gofmt plugin applies go/format so your Go code follows the exact same rules as gofmt, the shfmt plugin formats shell scripts with the same power as the standalone shfmt tool, and the tffmt plugin formats Terraform and HCL files using the same logic as terraform fmt.
Add the gofmt plugin to your dprint configuration to format Go files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-goat/releases/download/v1.0.0/gofmt.wasm"
],
"includes": [
"**/*.go"
],
"excludes": [
"**/vendor"
]
}dprint fmt --log-level=debugThis plugin mirrors gofmt and does not add custom options. If you pass an override config from dprint, it is accepted but ignored.
Add the shfmt plugin to your dprint configuration to format shell scripts.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-goat/releases/download/v1.0.0/shfmt.wasm"
],
"includes": [
"**/*.sh"
]
}dprint fmt --log-level=debugThis plugin mirrors shfmt and supports standard dprint indentation settings (tabs vs spaces, indent width). Additional shfmt-specific options are not exposed.
Add the tffmt plugin to your dprint configuration to format Terraform files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-goat/releases/download/v1.0.0/tffmt.wasm"
],
"includes": [
"**/*.tf"
]
}dprint fmt --log-level=debugThis plugin mirrors terraform fmt and does not add custom options. If you pass an override config from dprint, it is accepted but ignored.
Add the cuefmt plugin to your dprint configuration to format CUE files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-goat/releases/download/v1.0.0/cuefmt.wasm"
],
"includes": [
"**/*.cue"
]
}dprint fmt --log-level=debugThis plugin uses cuelang.org/go/cue/format and supports standard dprint indentation settings (tabs vs spaces, indent width).
Add the protofmt plugin to your dprint configuration to format Protobuf files.
{
"$schema": "https://dprint.dev/schemas/v0.json",
"plugins": [
"https://github.com/mridang/dprint-goat/releases/download/v1.0.0/protofmt.wasm"
],
"includes": [
"**/*.proto"
]
}dprint fmt --log-level=debugThis plugin implements a custom formatter designed to match buf format style and supports standard dprint indentation settings.
None.
Contributions are welcome! If you find a bug or have suggestions for improvement, please open an issue or submit a pull request.
Apache License 2.0 © 2025 Mridang Agarwalla