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

ci: enforce formatting, go mod tidy #288

Merged
merged 7 commits into from
May 30, 2024
Merged

ci: enforce formatting, go mod tidy #288

merged 7 commits into from
May 30, 2024

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented May 15, 2024

Adds CI checks for:

  • gofmt: important to ensure code is always formatted in the repo
  • go mod tidy: important to ensure deterministic dependencies

It does this via git/hooks/pre-commit, which can also be installed via make install-hooks.

.github/workflows/go.yml Outdated Show resolved Hide resolved
@cwaldren-ld cwaldren-ld marked this pull request as ready for review May 15, 2024 17:35
Copy link
Contributor

@dbolson dbolson left a comment

Choose a reason for hiding this comment

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

Would it make more sense to run these in a pre-commit hook and call the pre-commit hook in a GH action? Then we could get immediate, and skippable, feedback and use the same code for the CI build.

@cwaldren-ld
Copy link
Contributor Author

Yea, that'd probably be better - I didn't do it because I'm not a fan of pre-commit. But I can definitely make that change.

@cwaldren-ld cwaldren-ld force-pushed the cw/ci-improvements branch 5 times, most recently from 29cccd0 to a080532 Compare May 29, 2024 19:48
@cwaldren-ld cwaldren-ld requested a review from dbolson May 29, 2024 19:49
@cwaldren-ld
Copy link
Contributor Author

Ok, refactored to be a pre-commit hook.

@cwaldren-ld cwaldren-ld merged commit 6f5cafb into main May 30, 2024
2 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/ci-improvements branch May 30, 2024 16:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants