diff --git a/.golangci.yaml b/.golangci.yaml index da40f69c9a..93dedb38f0 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,13 +1,12 @@ run: timeout: 5m - go: '1.23.2' linters: disable-all: true enable: #- containedctx #- contextcheck - #- depguard + - depguard - errcheck #- errchkjson #- errname @@ -39,11 +38,12 @@ linters: linters-settings: depguard: - list-type: blacklist - packages: - - k8s.io/kubernetes - packages-with-error-messages: - k8s.io/kubernetes: "do not use k8s.io/kubernetes directly" + rules: + prevent_kubernetes_dependency: + list-mode: lax # allow unless explicitly denied + deny: + - pkg: k8s.io/kubernetes + desc: "do not use k8s.io/kubernetes directly" errcheck: exclude-functions: - encoding/json.Marshal @@ -83,12 +83,13 @@ linters-settings: - performance - style gofumpt: - lang-version: "1.23.2" extra-rules: true lll: line-length: 150 issues: + exclude-dirs: + - tilt_modules exclude-rules: # ignore errcheck for code under a /test folder - path: "test/*" diff --git a/Makefile b/Makefile index 01450e9393..96c6f85bfb 100644 --- a/Makefile +++ b/Makefile @@ -110,8 +110,8 @@ vet: ## Run go vet against code go vet ./... lint: ## Run linters against code - @go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0 - golangci-lint run --out-format=github-actions --timeout 600s --skip-files "tilt_modules" + @go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2 + golangci-lint run --out-format=colored-line-number --timeout 600s @go install github.com/yoheimuta/protolint/cmd/protolint@latest protolint lint -config_path=.protolint.yaml ./api