bump golangci-lint to latest and configure CLAUDE to use it on change#13656
bump golangci-lint to latest and configure CLAUDE to use it on change#13656glours merged 1 commit intodocker:mainfrom
Conversation
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the repo’s Go linting toolchain (golangci-lint) and adds project guidance for running lint/build/test, along with small code adjustments aligned with the updated linting expectations.
Changes:
- Bump the pinned
golangci-lintDocker image version used by thelintbake target. - Add
CLAUDE.mdwith build/test/lint and style guidance. - Refactor some string building in
publish.goto usefmt.Fprintf, and adjust an e2e test helper.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/e2e/compose_run_build_once_test.go | Removes a nolint on rand.Read in the test project-name helper. |
| pkg/compose/publish.go | Replaces WriteString(fmt.Sprintf(...)) with fmt.Fprintf when building messages. |
| Dockerfile | Updates pinned GOLANGCI_LINT_VERSION used in the lint stage. |
| CLAUDE.md | Adds documented build/test/lint commands and style constraints for the project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func randomProjectName(prefix string) string { | ||
| b := make([]byte, 4) // 4 bytes = 8 hex chars | ||
| rand.Read(b) //nolint:errcheck | ||
| rand.Read(b) | ||
| return fmt.Sprintf("%s-%s", prefix, hex.EncodeToString(b)) |
There was a problem hiding this comment.
rand.Read(b) returns an error, and .golangci.yml enables errcheck, so this will be flagged (and can also lead to flaky/duplicate project names if it ever fails). Since the previous //nolint:errcheck was removed, please handle the error explicitly (e.g., make randomProjectName take t testing.TB and t.Fatalf on error, or return (string, error) and propagate it).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What I did
Related issue
(not mandatory) A picture of a cute animal, if possible in relation to what you did