Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start using go fmt and reformat whole Dero source code #125

Open
Robyer opened this issue Jun 1, 2023 · 1 comment
Open

Start using go fmt and reformat whole Dero source code #125

Robyer opened this issue Jun 1, 2023 · 1 comment

Comments

@Robyer
Copy link

Robyer commented Jun 1, 2023

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.

@trekon1701
Copy link

trekon1701 commented Feb 4, 2024

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants