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

Set up CI, enforce gofmt #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Set up CI, enforce gofmt #3

wants to merge 2 commits into from

Conversation

dbrgn
Copy link
Contributor

@dbrgn dbrgn commented Feb 4, 2024

See diff - let's hope it works :)

Copy link
Member

@rnestler rnestler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

.github/workflows/ci.yml Outdated Show resolved Hide resolved
Comment on lines +29 to +30
- name: run gofmt
run: diff -u <(echo -n) <(gofmt -d ./)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it enough to just run gofmt with the -d flag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, for some reason they seem to think that it's helpful to return exit code 0 even if there are changes...

https://stackoverflow.com/questions/42510140/check-format-for-continous-integration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean I'd expect it to have a --check flag or similar and then return an error, but it doesn't seem to have that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected such a flag as well, but it probably breaks some kind of perceived unix philosophy - why implement a feature if you can do it with convoluted shell pipelines as well? 😂

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

Successfully merging this pull request may close these issues.

None yet

2 participants