Skip to content

ci: Upgrade golangci-linter to v2 #6739

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

Conversation

SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented May 13, 2025

This PR updates golangci-linter version to v2 (v2.1.6). It migrates the .golangci.yml to v2 and resolves some lint issues according to v2.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@SungJin1212 SungJin1212 changed the title Upgrade golangci-linter to v2 ci: Upgrade golangci-linter to v2 May 13, 2025
@dosubot dosubot bot added the go Pull requests that update Go code label May 13, 2025
@SungJin1212 SungJin1212 force-pushed the upgrade-golangci-linter-v2 branch from 9892da8 to 0b49e9d Compare May 14, 2025 04:36
@SungJin1212 SungJin1212 requested a review from yeya24 May 21, 2025 01:11
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Let's give it a try. Thanks!

@SungJin1212 SungJin1212 requested a review from friedrichg June 10, 2025 09:44
@SungJin1212 SungJin1212 force-pushed the upgrade-golangci-linter-v2 branch from 35f5192 to aaf5592 Compare June 10, 2025 09:48
Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

only a tiny typo. LGTM. Thanks for waiting 🙏

@@ -23,7 +23,7 @@ import (
util_log "github.com/cortexproject/cortex/pkg/util/log"
)

var errMaxGlobalSeriesPerUserValidation = errors.New("The ingester.max-global-series-per-user limit is unsupported if distributor.shard-by-all-labels is disabled")
var errMaxGlobalSeriesPerUserValidation = errors.New("the ingested.max-global-series-per-user limit is unsupported if distributor.shard-by-all-labels is disabled")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var errMaxGlobalSeriesPerUserValidation = errors.New("the ingested.max-global-series-per-user limit is unsupported if distributor.shard-by-all-labels is disabled")
var errMaxGlobalSeriesPerUserValidation = errors.New("the ingester.max-global-series-per-user limit is unsupported if distributor.shard-by-all-labels is disabled")

Comment on lines 33 to 34
// ErrNotFound is returned by ConsulClient.Get.
ErrNotFound = fmt.Errorf("Not found")
ErrNotFound = fmt.Errorf("not found")
Copy link
Member

Choose a reason for hiding this comment

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

I think this is never used, but I am not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is safe to delete since it is never used.

@SungJin1212 SungJin1212 force-pushed the upgrade-golangci-linter-v2 branch from aaf5592 to 3dc0291 Compare June 12, 2025 04:03
@SungJin1212 SungJin1212 force-pushed the upgrade-golangci-linter-v2 branch from 3dc0291 to bcb1843 Compare June 12, 2025 04:14
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 12, 2025
@friedrichg friedrichg merged commit fd1dca4 into cortexproject:master Jun 12, 2025
59 of 62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code lgtm This PR has been approved by a maintainer size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants