ci: add gofmt, vet, build and test gate - #33
Open
prakashUXtech wants to merge 1 commit into
Open
prakashUXtech wants to merge 1 commit into
prakashUXtech wants to merge 1 commit into
Conversation
This repo had no workflows, so nothing checked formatting, vet, build or tests on a pull request. Each step was measured against origin/main before being added, so the gate starts green instead of red: vet, build and tests were already clean; gofmt flagged 7 files, fixed by gofmt -w here. That diff is whitespace only — git diff -w against the parent is empty. Sticks to the Go toolchain's own checks rather than a third-party linter, so there's nothing extra to install or keep pinned.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This repo had no workflows at all, so nothing checked formatting, vet, build or tests when a PR opened.
The workflow runs four steps on every PR and on pushes to main: gofmt, go vet, go build, go test.
I ran each one against origin/main before adding it, so the gate passes on arrival instead of landing red and teaching everyone to ignore CI:
The seven gofmt files are fixed by
gofmt -win the same commit so the gate starts green. That part of the diff is whitespace only:git diff -wagainst the parent is empty, and the tests still pass after reformatting.It uses the Go toolchain's own checks rather than golangci-lint, so there is nothing extra to install or pin. golangci-lint is a reasonable follow-up, but it should be measured the same way first, since it will almost certainly report findings that need triaging before it can gate anything.