Skip to content

ci: bump golangci-lint to v2.1 #4747

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 1 commit into from
Apr 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
sudo apt -qy install libseccomp-dev
- uses: golangci/golangci-lint-action@v7
with:
version: v2.0
version: v2.1
Copy link
Member

Choose a reason for hiding this comment

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

How about deleting this version definition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assuming that if the version is not set, the latest one will be used, I don't think it's a good idea, because this will mean that over time our CI will break on its own (as newer golangci-lint will update or add more linters which may result in linter warnings).

By pinning the version, we avoid that breakage. When we update the version, we check that everything works fine, or fix the new issues found. In the meantime, the CI works.

It's basically the same argument as in commit b24fc9d

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note though that I don't specify the patch version, meaning the latest patch version will be used (for example, when I specify v2.1, it will use v2.1.5 as of today). This is because I hope that the patch version bump won't introduce any breakage (while the minor version bump, such as switching from v2.2 to v2.3, might).

Copy link
Member

Choose a reason for hiding this comment

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

Make sense, thanks your explanation.

# Extra linters, only checking new code from a pull request.
- name: lint-extra
if: github.event_name == 'pull_request'
Expand Down