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
- Host: GitHub
- URL: https://github.com/jakebailey/dprint-plugin-gofumpt
- Owner: jakebailey
- License: mit
- Created: 2025-12-13T00:16:06.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-03-13T18:02:29.000Z (3 months ago)
- Last Synced: 2026-03-14T06:17:19.682Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 231 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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 |