Conversation
`go vet` is ran by `golangci-lint`. Thus, it does not need to be ran separately.
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s linting setup to consolidate formatting/vet under golangci-lint and to lint code compiled with the integration and wporg_live build tags, aligning local linting and CI behavior.
Changes:
- Configure
golangci-lintto run withintegrationandwporg_livebuild tags and enablegofmtviagolangci-lint. - Simplify CI by removing standalone
gofmtandgo vetjobs (relying ongolangci-lintinstead). - Update integration tests to explicitly ignore
resp.Body.Close()errors to satisfyerrcheck.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
internal/integration/smoke_test.go |
Adjusts resp.Body.Close() defers in integration smoke tests. |
internal/integration/helpers_test.go |
Adjusts resp.Body.Close() defer in shared integration test helper. |
Makefile |
Removes standalone gofmt and go vet from make lint. |
.golangci.yml |
Adds build tags for linting and enables gofmt via golangci-lint config. |
.github/workflows/ci.yml |
Removes separate formatting and vet jobs, keeping lint + tidy + tests. |
Comments suppressed due to low confidence (1)
internal/integration/smoke_test.go:183
io.ReadAll(resp.Body)'s error is being intentionally ignored (body, _ := ...). Witherrcheckenabled andintegrationnow included ingolangci-lintbuild tags, this will be reported as an unchecked error and fail lint. Please handle the error (and fail the test on read failure) instead of discarding it.
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode != 200 {
t.Errorf("package detail status: got %d, want 200", resp.StatusCode)
}
body, _ := io.ReadAll(resp.Body)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| build-tags: | ||
| - integration | ||
| - wporg_live |
There was a problem hiding this comment.
Adding integration/wporg_live to run.build-tags will cause golangci-lint to lint the integration test packages too. There are existing errcheck violations under internal/integration (e.g., unchecked io.ReadAll errors), so this config change will likely make the lint job fail until those are fixed or excluded.
| build-tags: | |
| - integration | |
| - wporg_live |
golangci-lint: Lint withintegration&wporg_livebuild tagsgofmtviagolangci-lintgo vetgo vetis ran bygolangci-lint. Thus, it does not need to be ran separately.