-
Notifications
You must be signed in to change notification settings - Fork 1
add golangci-lint to pipeline #234
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
Changes from all commits
431f6e6
6f55c77
a1ac000
2c666a2
8cff935
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||||||||||||||||||||||||||||
| name: golangci-lint | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||
| branches: | ||||||||||||||||||||||||||||||||||
| - main | ||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||
| merge_group: | ||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||
| pull-requests: read | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
| golangci-lint: | ||||||||||||||||||||||||||||||||||
| name: golangci-lint | ||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Set up Go | ||||||||||||||||||||||||||||||||||
| uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| go-version-file: "go.mod" | ||||||||||||||||||||||||||||||||||
| cache: true | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Download dependencies | ||||||||||||||||||||||||||||||||||
| run: go mod download | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Generate code | ||||||||||||||||||||||||||||||||||
| run: make generate | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Run golangci-lint | ||||||||||||||||||||||||||||||||||
| uses: golangci/golangci-lint-action@v6 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| # Install from source to match Go 1.24 | ||||||||||||||||||||||||||||||||||
| install-mode: goinstall | ||||||||||||||||||||||||||||||||||
| version: v1.62.2 | ||||||||||||||||||||||||||||||||||
| args: --timeout=5m | ||||||||||||||||||||||||||||||||||
| # Show only new issues for PRs | ||||||||||||||||||||||||||||||||||
| only-new-issues: true | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reconsider Setting Consider using conditional logic to enable 🔧 Suggested conditional configuration - name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
args: --timeout=5m
# Use the existing .golangci.yml configuration
# Show only new issues for PRs
- only-new-issues: true
+ only-new-issues: ${{ github.event_name == 'pull_request' }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,6 @@ linters: | |
| enable: | ||
| - dupl | ||
| - errcheck | ||
| - exportloopref | ||
| - ginkgolinter | ||
| - goconst | ||
| - gocyclo | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -516,7 +516,7 @@ HELMIFY ?= helmify | |
| KUSTOMIZE_VERSION ?= v5.4.3 | ||
| CONTROLLER_TOOLS_VERSION ?= v0.16.5 | ||
| ENVTEST_VERSION ?= release-0.19 | ||
| GOLANGCI_LINT_VERSION ?= v1.59.1 | ||
| GOLANGCI_LINT_VERSION ?= v1.62.2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: golangci-lint v1.62.2 was released on 2024-11-25. Changes: several linter dependency bumps (fatcontext, ginkgolinter, errorlint, iface, revive, testifylint) and a fix to ignore cache error when file not found. [1][2] Sources: 🌐 Web query:
💡 Result: Short answer
What to do
Sources
Bump golangci-lint to v1.64.2 or newer for Go 1.24 support. v1.62.2 does not support Go 1.24. golangci-lint must be built with a Go version at least as new as the target Go version. v1.64.2 is the first version compiled with Go 1.24 support; using v1.62.2 will fail with "the Go language version used to build golangci-lint is lower than the targeted Go version (1.24.0)". 🤖 Prompt for AI Agents |
||
| HELM_VERSION ?= v3.14.2 | ||
| YQ_VERSION ?= v4.40.5 | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.