Repository navigation
build(lint): bump golangci-lint to v2.15.0 and fix its new findings - #14418
Merged
Merged
Conversation
runUp is above the cognitive complexity limit of the linter once gocognit is updated, because of the nested branches that select the services whose logs are followed. Move that selection to upOptions.attachedServices, without changing what it does, and cover its rules (--attach, --no-attach, --attach-dependencies, attach: false in the Compose file), which no test exercised. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
The release updates errcheck (1.20 to 1.30) and gocognit (1.2.1 to 1.3.0). errcheck now reports the receives from an error channel whose value is dropped on purpose, in three places: waiting for the attach copy to end after the context is done, draining the container wait channel of a failed hook, and waiting for Up to return in a test. Say why on each, rather than handling an error nobody can act on. gocognit's new count is handled by the previous commit. Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
dock-tor
approved these changes
Oct 28, 2026
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.
What this PR does, in one sentence
Moves the pinned linter from golangci-lint v2.13.2 to v2.15.0, the latest release, and brings the code back to zero findings under it.
Context
Running a current golangci-lint on
mainreports four issues that the pinned version does not, so anyone who lints locally with a recent binary sees noise that CI never shows, and the pin only gets further behind. The release updates errcheck (1.20 to 1.30) and gocognit (1.2.1 to 1.3.0), which explains the new reports:runUpnow counts 32 against the limit of 30, because of the nested branches that select the services whose logsupfollows;hook.go), draining the container wait channel of a failed hook (pre_start.go), and waiting forUpto return in a test (up_phases_test.go).What the PR brings
Two commits:
runUpis split. The selection of the attached services (--attach,--attach-dependencies,attach: falsein the Compose file,--no-attach) moves, as is, toupOptions.attachedServices. This is a pure extraction. No test covered those rules, so the commit adds a table test for them. It passes under both the old and the new linter.Dockerfile(the only place the version is pinned), with a reason on each of the three intentional discards instead of handling an error nobody can act on. Thesenolintdirectives are only needed by the new errcheck: the old linter would call them unused, which is why they go in with the bump rather than before it.Behavior is unchanged. Linting the branch with v2.15.0 reports no issue, and the same run on
mainreports the four above.🤖 Generated with Claude Code