Upgrade golangci-lint from v1 to v2#1279
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
4ae8bab to
45b0dd8
Compare
|
thanks for this @sebrandon1 ! I see that gosimple was working fine with golanci-lint v1... do you know what might have happened to make it so that it cannot be found on v2? |
45b0dd8 to
ccf9175
Compare
|
Thanks for catching that @flavianmissi! In golangci-lint v2, |
ccf9175 to
92dc720
Compare
92dc720 to
61a59f8
Compare
- Update GOLANGCI_LINT_VERSION from v1.64.8 to v2.0.2 - Migrate .golangci.yaml to v2 format: - Add version: "2" declaration - Move gofumpt to formatters.enable section - Remove gosimple linter (merged into staticcheck in v2) Tracking: redhat-best-practices-for-k8s/telco-bot#49
- Update golangci-lint version from v2.11.3 to v2.11.4 in Makefile - Remove staticcheck exclusions for QF1001, QF1004, QF1008, ST1005, ST1012, ST1019 and enable errcheck linter - Fix duplicate imports by consolidating to single aliases (ST1019) - Remove unnecessary embedded field selectors (QF1008) - Use strings.ReplaceAll instead of strings.Replace with -1 (QF1004) - Apply De Morgan law simplification (QF1001) - Lowercase error strings per Go conventions (ST1005) - Rename UserTagsNotDefined to ErrUserTagsNotDefined (ST1012)
61a59f8 to
cc45416
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (29)
WalkthroughThis pull request consolidates Kubernetes API type imports, refactors direct field access patterns on Kubernetes resources to bypass embedded ObjectMeta, updates string manipulation APIs, renames a sentinel error, and adjusts linter configuration. The changes affect approximately 30 files but maintain consistent, mechanical patterns across the codebase. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 9 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (9 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@sebrandon1: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
.golangci.yamlto v2 formatChanges Made
version: "2"declarationgofumpttoformatters.enableTest plan
Tracking: redhat-best-practices-for-k8s/telco-bot#49
Summary by CodeRabbit
Release Notes
Chores
Refactor
Style