Code formatting helps make your codebase easier to read, write and maintain. DeepSource offers Transformers, which allows you to format your code on autopilot with every commit you make with popular code formatters like gofmt for Go, black
for Python, and many more.
Until now, for Go code, we just supported gofmt
, but to cater to the requests of our community, we are also adding support for gofumpt in our Transformers, which enforces a stricter format than gofmt
.
To have it integrate with your existing DeepSource flow, all you have to do is type in the following entry into .deepsource.toml
:
[[transformers]]
name = "gofumpt"
enabled = true
It is also fine if you use gofmt
as a transformer and want to move to gofumpt
. Just replace gofmt
with gofumpt
.
If you are feeling lazy, you can auto generate the config from the DeepSource’s Dashboard too:
Select repository → Settings → Generate configuration (under Analysis Settings ) and select the gofumpt from the list of Transformers
It automatically regenerates the configuration for you and would get the gofumpt
transformer up and running for your project.