gofumpt is becoming the de-facto due to it's integration with gopls. gofumpt has a bit more strict ruleset for formatting than gofmt + goimports to more enhance consistency. And due to the integration with gopls, it's a bit easier to integrate with newer/common "format-on-save" workflows that format using gopls. gopls is currently the expected way to integrate this within VSCode, vim, Zed, etc.
gofumpt rules are effectively a superset and are entirely backwards compatible, meaning that a file formatted with gofumpt will pass both gofmt and goimports checks without additional changes, gofumpt is purely more strict.
So I believe we could replace these two tools with just gofumpt.
Feature Description
gofumpt
is becoming the de-facto due to it's integration withgopls
.gofumpt
has a bit more strict ruleset for formatting thangofmt
+goimports
to more enhance consistency. And due to the integration withgopls
, it's a bit easier to integrate with newer/common "format-on-save" workflows that format usinggopls
.gopls
is currently the expected way to integrate this within VSCode, vim, Zed, etc.gofumpt
rules are effectively a superset and are entirely backwards compatible, meaning that a file formatted withgofumpt
will pass bothgofmt
andgoimports
checks without additional changes,gofumpt
is purely more strict.So I believe we could replace these two tools with just
gofumpt
.As an example commit of how the more strict formatting looks: https://github.com/mattrobenolt/vitess/commit/259e86bb3bb2d083e10e71048b745068fc8d2eb7
Use Case(s)
Code editors / IDEs