From a88da940220d422b432c2be154c1fdfe5efeeaff Mon Sep 17 00:00:00 2001 From: dongjiang Date: Fri, 6 Mar 2026 20:34:36 +0800 Subject: [PATCH 1/4] Bump golangci-lint version to v2.10.1 --- .github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e19f779472..2e51cd5a1f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -34,6 +34,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # tag=v9.2.0 with: - version: v2.8.0 + version: v2.10.1 args: --output.text.print-linter-name=true --output.text.colors=true --timeout 10m working-directory: ${{matrix.working-directory}} From e079ff8662cbd1f506b495c2eedd322283b7b07d Mon Sep 17 00:00:00 2001 From: dongjiang Date: Fri, 6 Mar 2026 20:46:54 +0800 Subject: [PATCH 2/4] fix make lint Signed-off-by: dongjiang --- .golangci.yml | 5 +++++ pkg/certwatcher/metrics/metrics.go | 2 +- pkg/log/log_test.go | 2 +- pkg/metrics/workqueue.go | 2 +- pkg/webhook/admission/metrics/metrics.go | 2 +- tools/setup-envtest/version/version_test.go | 2 -- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5c86af65a3..25bcdd7521 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -177,6 +177,11 @@ linters: - linters: - revive path: .*/internal/.* + # Allow 'version' as a package name even though it conflicts with Go 1.24+ stdlib + - linters: + - revive + path: tools/setup-envtest/version/.*\.go$ + text: 'var-naming: avoid package names that conflict with Go standard library package names' - linters: - unused # Seems to incorrectly trigger on the two implementations that are only diff --git a/pkg/certwatcher/metrics/metrics.go b/pkg/certwatcher/metrics/metrics.go index f128abbcf0..579bfdad06 100644 --- a/pkg/certwatcher/metrics/metrics.go +++ b/pkg/certwatcher/metrics/metrics.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package metrics +package metrics //nolint:revive import ( "github.com/prometheus/client_golang/prometheus" diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index f56aef3706..8ff967290c 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package log +package log //nolint:revive import ( "errors" diff --git a/pkg/metrics/workqueue.go b/pkg/metrics/workqueue.go index cd7ccc773e..4d000e721d 100644 --- a/pkg/metrics/workqueue.go +++ b/pkg/metrics/workqueue.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package metrics +package metrics //nolint:revive // Metrics subsystem and all keys used by the workqueue. const ( diff --git a/pkg/webhook/admission/metrics/metrics.go b/pkg/webhook/admission/metrics/metrics.go index 358a3a9162..26e9575e84 100644 --- a/pkg/webhook/admission/metrics/metrics.go +++ b/pkg/webhook/admission/metrics/metrics.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package metrics +package metrics //nolint:revive import ( "github.com/prometheus/client_golang/prometheus" diff --git a/tools/setup-envtest/version/version_test.go b/tools/setup-envtest/version/version_test.go index 4178cac870..055288a33a 100644 --- a/tools/setup-envtest/version/version_test.go +++ b/tools/setup-envtest/version/version_test.go @@ -8,9 +8,7 @@ You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. */ From 306aad4ed7496801c2880cd4e7392e419d0625eb Mon Sep 17 00:00:00 2001 From: dongjiang Date: Mon, 9 Mar 2026 21:40:48 +0800 Subject: [PATCH 3/4] fix by codereview Signed-off-by: dongjiang --- .golangci.yml | 5 ----- tools/setup-envtest/version/version_suite_test.go | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 25bcdd7521..5c86af65a3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -177,11 +177,6 @@ linters: - linters: - revive path: .*/internal/.* - # Allow 'version' as a package name even though it conflicts with Go 1.24+ stdlib - - linters: - - revive - path: tools/setup-envtest/version/.*\.go$ - text: 'var-naming: avoid package names that conflict with Go standard library package names' - linters: - unused # Seems to incorrectly trigger on the two implementations that are only diff --git a/tools/setup-envtest/version/version_suite_test.go b/tools/setup-envtest/version/version_suite_test.go index 99c623e8d4..42901a09e7 100644 --- a/tools/setup-envtest/version/version_suite_test.go +++ b/tools/setup-envtest/version/version_suite_test.go @@ -12,6 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +//nolint:revive package version import ( From da12d45df990d2f9050eb68856e9b4a3f2accc71 Mon Sep 17 00:00:00 2001 From: dongjiang Date: Mon, 9 Mar 2026 22:10:56 +0800 Subject: [PATCH 4/4] update fix lint Signed-off-by: dongjiang --- .golangci.yml | 4 ++++ pkg/certwatcher/metrics/metrics.go | 2 +- pkg/log/log_test.go | 2 +- pkg/metrics/workqueue.go | 2 +- pkg/webhook/admission/metrics/metrics.go | 2 +- tools/setup-envtest/version/version_suite_test.go | 1 - 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 5c86af65a3..d3535afff2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -195,6 +195,10 @@ linters: - staticcheck path: (.+)\.go$ text: (ST1000|QF1008) + # Allow 'version' as a package name even though it conflicts with Go 1.24+ stdlib + - linters: + - revive + text: 'var-naming: avoid package names that conflict with Go standard library package names' issues: max-issues-per-linter: 0 max-same-issues: 0 diff --git a/pkg/certwatcher/metrics/metrics.go b/pkg/certwatcher/metrics/metrics.go index 579bfdad06..f128abbcf0 100644 --- a/pkg/certwatcher/metrics/metrics.go +++ b/pkg/certwatcher/metrics/metrics.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package metrics //nolint:revive +package metrics import ( "github.com/prometheus/client_golang/prometheus" diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index 8ff967290c..f56aef3706 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package log //nolint:revive +package log import ( "errors" diff --git a/pkg/metrics/workqueue.go b/pkg/metrics/workqueue.go index 4d000e721d..cd7ccc773e 100644 --- a/pkg/metrics/workqueue.go +++ b/pkg/metrics/workqueue.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package metrics //nolint:revive +package metrics // Metrics subsystem and all keys used by the workqueue. const ( diff --git a/pkg/webhook/admission/metrics/metrics.go b/pkg/webhook/admission/metrics/metrics.go index 26e9575e84..358a3a9162 100644 --- a/pkg/webhook/admission/metrics/metrics.go +++ b/pkg/webhook/admission/metrics/metrics.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package metrics //nolint:revive +package metrics import ( "github.com/prometheus/client_golang/prometheus" diff --git a/tools/setup-envtest/version/version_suite_test.go b/tools/setup-envtest/version/version_suite_test.go index 42901a09e7..99c623e8d4 100644 --- a/tools/setup-envtest/version/version_suite_test.go +++ b/tools/setup-envtest/version/version_suite_test.go @@ -12,7 +12,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -//nolint:revive package version import (