diff --git a/hack/golangci-strict.yaml b/hack/golangci-strict.yaml index e07ab4d1c65..b54a11f3b40 100644 --- a/hack/golangci-strict.yaml +++ b/hack/golangci-strict.yaml @@ -15,6 +15,12 @@ issues: - path: conversion\.go linters: - ineffassign + # The Kubernetes naming convention for conversion functions uses underscores + # and intentionally deviates from normal Go conventions to make those function + # names more readable. Same for SetDefaults_*. + - linters: + - stylecheck + text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)" linters: disable-all: false # in contrast to golangci.yaml, the default set of linters remains enabled diff --git a/hack/golangci.yaml b/hack/golangci.yaml index d34f1e20900..280037377bf 100644 --- a/hack/golangci.yaml +++ b/hack/golangci.yaml @@ -16,6 +16,12 @@ issues: - path: (pkg/volume/*|test/*|azure/*|pkg/cmd/wait*|request/bearertoken/*|metrics/*|filters/*) # not in golangci-strict.yaml linters: # not in golangci-strict.yaml - gocritic # not in golangci-strict.yaml + # The Kubernetes naming convention for conversion functions uses underscores + # and intentionally deviates from normal Go conventions to make those function + # names more readable. Same for SetDefaults_*. + - linters: + - stylecheck + text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)" linters: disable-all: true # not disabled in golangci-strict.yaml