Closed derricw closed 2 years ago
In addition to formatting all existing files, it might make sense to add a CI step to verify proper formatting before allowing a PR to be merged.
I've intentionally disabled gofmt in my nvim because it screwed up / kept ignoring the settings defined inside the .editorconfig
. If someone here knows how to fix that I'd happily re-enable it.
No idea, I use nvim but not .editorconfig
. I think gofmt
just has one set of rules and doesn't care about anything. It is very opinionated.
If you editor follows the .editorconfig
in this repository there should be no formatting issues when setting a PR.
Unless someone could tell how gofmt can be made respect things like custom indentation and line-length, I'd stick to .editorconfig
and close this issue. Feel free to comment suggestions and I'll happily reopen it.
Most people use plugins for their text editors that run gofmt automatically (for example this is default behavior of vim-go as well as vscode's go plugin), which means that if I submit a PR, it is going to be 90% formatting changes.
I would consider running
gofmt
yourself on all your go files so that people don't have to struggle with this.