chore: update linter and fix lints#949
Conversation
WalkthroughThis PR updates the golangci-lint linter version from v2.5.0 to v2.12.2 and changes the installer source, then updates security linter suppression annotations across the codebase to align with the newer linter release. ChangesSecurity Linter Updates
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Line 72: Replace the unsafe "curl ... | sh" installer invocation in the
Makefile with a verified installation flow: stop piping remote install.sh to sh
and instead either (preferred) remove this ad-hoc install and use the pinned
GitHub Action golangci-lint-action in CI, or (if keeping local Makefile install)
download the specific release tarball for $(GOLANGCI_LINT_VERSION), verify its
checksum/signature against a trusted source, then extract and install to
$(GOPATH)/bin; update the Makefile target that currently runs "curl -sSfL
https://golangci-lint.run/install.sh | sh -s -- -b $(GOPATH)/bin
$(GOLANGCI_LINT_VERSION)" accordingly and ensure the new flow references the
same GOLANGCI_LINT_VERSION variable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: dfd232f5-26d4-44a0-8040-00d16da0b7c7
📒 Files selected for processing (4)
Makefilepkg/awsutil/sts.gopkg/elevate/elevate_test.gopkg/utils/jwt_test.go
|
/retest |
|
@feichashao: all tests passed! 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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feichashao, MitaliBhalla The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #949 +/- ##
=======================================
Coverage 54.02% 54.02%
=======================================
Files 82 82
Lines 6323 6323
=======================================
Hits 3416 3416
Misses 2462 2462
Partials 445 445
🚀 New features to boost your workflow:
|
What type of PR is this?
What this PR does / Why we need it?
This PR updates the golangci-lint version and updates the install script URL as per https://golangci-lint.run/docs/welcome/install/local/ .
This PR also fixes some lint checks which are discovered in the new linter version.
Which Jira/Github issue(s) does this PR fix?
Special notes for your reviewer
Unit Test Coverage
Guidelines
Test coverage checks
Pre-checks (if applicable)
/label tide/merge-method-squash
Summary by CodeRabbit