Skip to content
Merged
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
7 changes: 5 additions & 2 deletions .custom-gcl.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: v2.4.0
name: golangci-lint-kube-api-linter
version: v2.5.0
name: golangci-lint-custom
destination: ./bin
plugins:
- module: 'sigs.k8s.io/kube-api-linter'
version: v0.0.0-20250819121536-a575e84f4ce8
- module: "go.uber.org/nilaway"
import: "go.uber.org/nilaway/cmd/gclplugin"
version: "v0.0.0-20250821055425-361559d802f0"
23 changes: 23 additions & 0 deletions .golangci-nilaway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "2"
run:
issues-exit-code: 1
output:
formats:
text:
path: stdout
linters:
default: none
enable:
- nilaway
settings:
custom:
nilaway:
type: "module"
description: Static analysis tool to detect potential nil panics in Go code.
settings:
include-pkgs: ""
exclude-file-docstrings: ignore_autogenerated
issues:
max-issues-per-linter: 0
max-same-issues: 0
new: false
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ lint: ## Run lint against code.
$(GOLANGCI_LINT) run -c .golangci.yml

.PHONY: lint
lint-api: golangci-lint-kal ## Run lint against code.
$(GOLANGCI_LINT_KAL) run -c .golangci-kal.yml
lint-api: golangci-lint-custom ## Run lint against code.
$(GOLANGCI_LINT_CUSTOM) run -c .golangci-kal.yml

.PHONY: nilcheck
nilcheck: nilaway ## Run nil check against code.
go list ./... | xargs -I {} -d '\n' nilaway -include-pkgs {} -exclude-file-docstrings "ignore_autogenerated" ./...
nilcheck: golangci-lint-custom ## Run nil check against code.
$(GOLANGCI_LINT_CUSTOM) run -c .golangci-nilaway.yml

.PHONY: vulncheck
vulncheck: govulncheck ## Run vulnerability check against code.
Expand Down Expand Up @@ -358,7 +358,7 @@ GOVULNC ?= $(LOCALBIN)/govulncheck
MOCKGEN ?= $(LOCALBIN)/mockgen
GOWRAP ?= $(CACHE_BIN)/gowrap
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
GOLANGCI_LINT_KAL ?= $(CACHE_BIN)/golangci-lint-kube-api-linter
GOLANGCI_LINT_CUSTOM ?= $(CACHE_BIN)/golangci-lint-custom
S5CMD ?= $(CACHE_BIN)/s5cmd

## Tool Versions
Expand Down Expand Up @@ -458,9 +458,9 @@ golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

.phony: golangci-lint-kal
golangci-lint-kal: $(GOLANGCI_LINT_KAL)
$(GOLANGCI_LINT_KAL): $(GOLANGCI_LINT) # Build golangci-lint-kal from custom configuration.
.phony: golangci-lint-custom
golangci-lint-custom: $(GOLANGCI_LINT_CUSTOM)
$(GOLANGCI_LINT_CUSTOM): $(GOLANGCI_LINT) # Build golangci-lint-custom from custom configuration.
$(GOLANGCI_LINT) custom

.PHONY: nilaway
Expand Down
Loading