An open API service indexing awesome lists of open source software.

https://github.com/jakebailey/dprint-plugin-gofumpt

dprint plugin for gofumpt
https://github.com/jakebailey/dprint-plugin-gofumpt

Last synced: 2 months ago
JSON representation

dprint plugin for gofumpt

Awesome Lists containing this project

README

          

# dprint-plugin-gofumpt

A [dprint](https://dprint.dev/) plugin for formatting Go code using
[gofumpt](https://github.com/mvdan/gofumpt).

## Getting Started

Run the command below to add the plugin:

```sh
dprint config add jakebailey/gofumpt
```

After adding the plugin, configure the plugin in `dprint.json`:

```jsonc
{
// ...
"gofumpt": {
// Copy these from your go.mod file!
"langVersion": "go1.24",
"modulePath": "github.com/myorg/myproject"
},
"plugins": [
"https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.8.wasm"
]
}
```

## Configuration

It is recommended to set both `langVersion` and `modulePath` for consistent
formatting results, as the plugin cannot infer this information from `go.mod`.

| Property | Type | Default | Description |
| ------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `langVersion` | `string` | `""` | The Go language version to target (e.g., `"go1.24"`). Must be a valid [Go version string](https://pkg.go.dev/go/version#IsValid). If empty, defaults to `go1`. |
| `modulePath` | `string` | `""` | The module path of the package being formatted. Used for import sorting. |
| `extraRules` | `boolean` | `false` | Enable extra formatting rules beyond the default gofumpt rules. |

## Versions

This plugin is versioned separately from `gofumpt`. Below is a table of which
plugin versions correspond to which `gofumpt` versions.

| Plugin Version | gofumpt Version |
| -------------- | ------------------------------------ |
| v0.0.2+ | v0.9.3-0.20251215221355-d3e4b13ef7fa |
| v0.0.1 | v0.9.2 |