Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: "2"
run:
timeout: 5m
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ catalog-push: ## Push a catalog image.
$(MAKE) docker-push IMG=$(CATALOG_IMG)

CILIUM_EBPF_VERSION := v0.18.0
GOLANGCI_LINT_VERSION = v1.54.2
GOLANGCI_LINT_VERSION = v2.12.2
CLANG ?= clang
CFLAGS := -O2 -g -Wall -Werror $(CFLAGS)
GOOS ?= linux
Expand All @@ -428,7 +428,7 @@ LOCAL_GENERATOR_IMAGE ?= ebpf-generator:latest
##@ eBPF development
.PHONY: prereqs
prereqs: ## Check if prerequisites are met, and installing missing dependencies
test -f $(shell go env GOPATH)/bin/golangci-lint || GOFLAGS="" go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
test -f $(shell go env GOPATH)/bin/golangci-lint || GOFLAGS="" go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use $(GOBIN) for the golangci-lint existence check.

Line 431 checks only GOPATH/bin; when GOBIN is set, this can cause redundant installs on every make prereqs.

Suggested fix
-	test -f $(shell go env GOPATH)/bin/golangci-lint || GOFLAGS="" go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
+	test -f $(GOBIN)/golangci-lint || GOFLAGS="" go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
🤖 Prompt for 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.

In `@Makefile` at line 431, The Makefile currently checks for golangci-lint only
under $(shell go env GOPATH)/bin causing installs when GOBIN is set; update the
existence check to use $(or $(GOBIN),$(shell go env GOPATH)/bin)/golangci-lint
(or equivalent shell logic) so it prefers $(GOBIN) when present, then fallbacks
to GOPATH/bin, and keep the install command using ${GOLANGCI_LINT_VERSION}
unchanged; specifically modify the test command that references $(shell go env
GOPATH)/bin/golangci-lint to use the computed bin dir via $(or $(GOBIN),$(shell
go env GOPATH)/bin)/golangci-lint.

test -f $(shell go env GOPATH)/bin/bpf2go || go install github.com/cilium/ebpf/cmd/bpf2go@${CILIUM_EBPF_VERSION}
test -f $(shell go env GOPATH)/bin/kind || go install sigs.k8s.io/kind@latest

Expand Down