Open Robyer opened 1 year ago
Great idea/requirement ... I suggest setting up a check that runs the formatter in "check-only" mode, so if not formatted properly would output the diff and return a bad status code, preventing merge.
An example would be like using (e.g.) terraform fmt -check=true -list=true -diff=true -recursive
would return non-0 on error and present a diff.
I think the equivalent is gofmt -d /path/to/repo/
Since Dero team started accepting code contributions from community, the first thing that should happen is reformatting whole source code with
go fmt
, which is de-facto standard in the whole Go ecosystem. It is integrated in code editors (e.g. VS Code) and IDEs and is usually applied automatically on save. It doesn't seem to be currently used for Dero source code though.Since this affects whole codebase, it must be done by @CaptainDero himself (cannot be done via community pull-request as it would break all the potential code in progress in private repositories).
This should be done ASAP, because otherwise every PR will cause reformatting of changed files and the real changes will be harder to see due to formatting noise (as can be seen already in recent PRs, e.g. here), and there is also risk of changes going back and forth if Dero devs continue making changes internally without the
go fmt
.And of course, community contributions (PRs) should also be required to be formatted in this standard way.