From 74ff08fa15b60f3e115f53d835a781cd03c4a9a7 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 27 Nov 2024 01:18:47 +0200 Subject: [PATCH 1/2] govet: add `stdversion` analyzer --- .golangci.next.reference.yml | 2 ++ .golangci.reference.yml | 2 ++ jsonschema/golangci.jsonschema.json | 1 + jsonschema/golangci.next.jsonschema.json | 1 + pkg/golinters/govet/govet.go | 2 ++ 5 files changed, 8 insertions(+) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index 9779fd04556d..5722b7b0ac80 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -1801,6 +1801,8 @@ linters-settings: - sortslice # Check signature of methods of well-known interfaces. - stdmethods + # Check for uses of too-new standard library symbols. + - stdversion # Check for string(int) conversions. - stringintconv # Check that struct field tags conform to reflect.StructTag.Get. diff --git a/.golangci.reference.yml b/.golangci.reference.yml index f708e27716ad..a2dabcd36b51 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -1801,6 +1801,8 @@ linters-settings: - sortslice # Check signature of methods of well-known interfaces. - stdmethods + # Check for uses of too-new standard library symbols. + - stdversion # Check for string(int) conversions. - stringintconv # Check that struct field tags conform to reflect.StructTag.Get. diff --git a/jsonschema/golangci.jsonschema.json b/jsonschema/golangci.jsonschema.json index 4546614f20f9..7aed96c2147e 100644 --- a/jsonschema/golangci.jsonschema.json +++ b/jsonschema/golangci.jsonschema.json @@ -200,6 +200,7 @@ "slog", "sortslice", "stdmethods", + "stdversion", "stringintconv", "structtag", "testinggoroutine", diff --git a/jsonschema/golangci.next.jsonschema.json b/jsonschema/golangci.next.jsonschema.json index 50d694ec31cd..b3a5453dd455 100644 --- a/jsonschema/golangci.next.jsonschema.json +++ b/jsonschema/golangci.next.jsonschema.json @@ -200,6 +200,7 @@ "slog", "sortslice", "stdmethods", + "stdversion", "stringintconv", "structtag", "testinggoroutine", diff --git a/pkg/golinters/govet/govet.go b/pkg/golinters/govet/govet.go index eb63a5d3342c..451a055ebe1b 100644 --- a/pkg/golinters/govet/govet.go +++ b/pkg/golinters/govet/govet.go @@ -40,6 +40,7 @@ import ( "golang.org/x/tools/go/analysis/passes/slog" "golang.org/x/tools/go/analysis/passes/sortslice" "golang.org/x/tools/go/analysis/passes/stdmethods" + "golang.org/x/tools/go/analysis/passes/stdversion" "golang.org/x/tools/go/analysis/passes/stringintconv" "golang.org/x/tools/go/analysis/passes/structtag" "golang.org/x/tools/go/analysis/passes/testinggoroutine" @@ -89,6 +90,7 @@ var ( slog.Analyzer, sortslice.Analyzer, stdmethods.Analyzer, + stdversion.Analyzer, stringintconv.Analyzer, structtag.Analyzer, testinggoroutine.Analyzer, From 878644d6df6cc4ef196e4735a45cce6155582cc7 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Wed, 27 Nov 2024 16:03:30 +0200 Subject: [PATCH 2/2] Revert .golangci.reference.yml and golangci.jsonschema.json --- .golangci.reference.yml | 2 -- jsonschema/golangci.jsonschema.json | 1 - 2 files changed, 3 deletions(-) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index a2dabcd36b51..f708e27716ad 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -1801,8 +1801,6 @@ linters-settings: - sortslice # Check signature of methods of well-known interfaces. - stdmethods - # Check for uses of too-new standard library symbols. - - stdversion # Check for string(int) conversions. - stringintconv # Check that struct field tags conform to reflect.StructTag.Get. diff --git a/jsonschema/golangci.jsonschema.json b/jsonschema/golangci.jsonschema.json index 7aed96c2147e..4546614f20f9 100644 --- a/jsonschema/golangci.jsonschema.json +++ b/jsonschema/golangci.jsonschema.json @@ -200,7 +200,6 @@ "slog", "sortslice", "stdmethods", - "stdversion", "stringintconv", "structtag", "testinggoroutine",