Skip to content
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

golangci: Enable errorlint #31458

Merged
merged 2 commits into from
Apr 3, 2024
Merged

golangci: Enable errorlint #31458

merged 2 commits into from
Apr 3, 2024

Conversation

jrajahalme
Copy link
Member

@jrajahalme jrajahalme commented Mar 18, 2024

Enable errorlint in golangci-lint to catch uses of improper formatters for Go errors. This helps avoid unnecessary error/warning logs that cause CI flakes, when benign error cases are not caught due to failing error unwrapping when a string or value formatter has been used instead of the dedicated %w.

Note to reviewers: Only fmt.Errorf() calls should have been changed to use %w. Other changes to use errors.Is() and errors.As() to replace comparison and type cast, respectively should be reviewed carefully.

Note to backporters: In addition to resolving conflicts, it is possible that the release branches have more code that needs to be revised. Use make lint locally to find any additional code sites that need to be fixed. Unfortunately the fix options seems to not be implemented for errorlint.

Related: #31147

@jrajahalme jrajahalme requested review from a team as code owners March 18, 2024 15:54
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 18, 2024
@jrajahalme jrajahalme added backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Apr 5, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.14 in 1.14.10 Apr 5, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.13 in 1.13.15 Apr 5, 2024
@asauber asauber added this to Backport pending to v1.13 in 1.13.16 Apr 11, 2024
@asauber asauber removed this from Backport pending to v1.13 in 1.13.15 Apr 11, 2024
@asauber asauber added this to Backport pending to v1.15 in 1.15.5 Apr 11, 2024
@asauber asauber removed this from Backport pending to v1.15 in 1.15.4 Apr 11, 2024
@asauber asauber added this to Backport pending to v1.14 in 1.14.11 Apr 11, 2024
@asauber asauber removed this from Backport pending to v1.14 in 1.14.10 Apr 11, 2024
@github-actions github-actions bot added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. labels Apr 17, 2024
@nebril nebril moved this from Backport pending to v1.13 to Backport done to v1.13 in 1.13.16 May 10, 2024
@nebril nebril moved this from Backport pending to v1.14 to Backport done to v1.14 in 1.14.11 May 10, 2024
@nebril nebril moved this from Backport pending to v1.15 to Backport done to v1.15 in 1.15.5 May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/author The backport will be carried out by the author of the PR. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. kind/enhancement This would improve or streamline existing functionality. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
No open projects
1.13.16
Backport done to v1.13
1.14.11
Backport done to v1.14
1.15.5
Backport done to v1.15
Status: Released
Status: Released
Status: Released
Development

Successfully merging this pull request may close these issues.

None yet