Skip to content

update go to 1.24 and golangci-lint to 2.1.5 #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025

Conversation

crazy-max
Copy link
Member

No description provided.

@crazy-max crazy-max requested a review from thaJeztah May 19, 2025 12:45
@crazy-max crazy-max marked this pull request as ready for review May 19, 2025 12:45
.golangci.yml Outdated
Comment on lines 26 to 30
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
Copy link
Member

Choose a reason for hiding this comment

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

ISTR specifying these makes it skip some (not run "more")? Wondering if CY is happy if presents is empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah true and it fails for comments preset:

#20 [lint 1/1] RUN --mount=type=bind,target=.   --mount=type=cache,target=/root/.cache   --mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint   golangci-lint run ./...      
#20 0.995 annotation/annotation.go:15:1: package-comments: should have a package comment (revive)
#20 0.995 package annotation
#20 0.995 ^
#20 0.995 clidocstool.go:15:1: package-comments: should have a package comment (revive)
#20 0.995 package clidocstool
#20 0.995 ^
#20 0.995 2 issues:
#20 0.995 * revive: 2
#20 ERROR: process "/bin/sh -c golangci-lint run ./..." did not complete successfully: exit code: 1

I guess we can just exclude this one as it was not catched before?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yes, either we can add a package comment (if there's only a few) or we can add excludes for a couple; https://github.com/moby/moby/blob/7937f0846c130e91836f5f640c41ce12d07da4c8/.golangci.yml#L152-L158

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yes, either we can add a package comment (if there's only a few) or we can add excludes for a couple; https://github.com/moby/moby/blob/7937f0846c130e91836f5f640c41ce12d07da4c8/.golangci.yml#L152-L158

Is this one complementary or a duplicate https://github.com/moby/moby/blob/7937f0846c130e91836f5f640c41ce12d07da4c8/.golangci.yml#L146-L150 of staticcheck - -ST1000? Here seems only a revive rule.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comments to packages

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 881b2fe into docker:main May 19, 2025
6 checks passed
@crazy-max crazy-max deleted the go-1.24 branch May 19, 2025 13:44
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.

2 participants