mrusme / superhighway84

USENET-inspired, uncensorable, decentralized internet discussion system running on IPFS & OrbitDB
https://xn--gckvb8fzb.com/superhighway84
GNU General Public License v3.0
694 stars 24 forks source link

Run `gofmt` so your PR's don't have formatting issues #20

Closed derricw closed 2 years ago

derricw commented 2 years ago

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.

d1vanloon commented 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.

mrusme commented 2 years ago

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.

derricw commented 2 years ago

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.

mrusme commented 2 years ago

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.