Skip to content

bump golangci-lint to latest and configure CLAUDE to use it on change#13656

Merged
glours merged 1 commit intodocker:mainfrom
ndeloof:lint
Mar 23, 2026
Merged

bump golangci-lint to latest and configure CLAUDE to use it on change#13656
glours merged 1 commit intodocker:mainfrom
ndeloof:lint

Conversation

@ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Mar 22, 2026

What I did

Related issue

(not mandatory) A picture of a cute animal, if possible in relation to what you did

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Copilot AI review requested due to automatic review settings March 22, 2026 17:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-lint Docker image version used by the lint bake target.
  • Add CLAUDE.md with build/test/lint and style guidance.
  • Refactor some string building in publish.go to use fmt.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.

Comment on lines 96 to 99
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))
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@glours glours merged commit 5de4353 into docker:main Mar 23, 2026
44 checks passed
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.

3 participants