From 5afab67c8d88d683b552cfd4b3b656317a1d45d7 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 19 Mar 2024 01:59:33 +0100 Subject: [PATCH] chore: re-organize options --- .golangci.next.reference.yml | 60 +++++++++++++++++----------------- pkg/config/linters_settings.go | 5 +-- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/.golangci.next.reference.yml b/.golangci.next.reference.yml index eb3042493243..61b94f60ce98 100644 --- a/.golangci.next.reference.yml +++ b/.golangci.next.reference.yml @@ -1074,36 +1074,6 @@ linters-settings: - Katakana govet: - # Settings per analyzer. - settings: - # Analyzer name, run `go tool vet help` to see all analyzers. - printf: - # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). - # Default: [] - funcs: - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - shadow: - # Whether to be strict about shadowing; can be noisy. - # Default: false - strict: true - unusedresult: - # Comma-separated list of functions whose results must be used - # (in addition to default: - # context.WithCancel, context.WithDeadline, context.WithTimeout, context.WithValue, errors.New, fmt.Errorf, - # fmt.Sprint, fmt.Sprintf, sort.Reverse - # ). - # Default: [] - funcs: - - pkg.MyFunc - # Comma-separated list of names of methods of type func() string whose results must be used - # (in addition to default Error,String) - # Default: [] - stringmethods: - - MyMethod - # Disable all analyzers. # Default: false disable-all: true @@ -1210,6 +1180,36 @@ linters-settings: - unusedresult - unusedwrite + # Settings per analyzer. + settings: + # Analyzer name, run `go tool vet help` to see all analyzers. + printf: + # Comma-separated list of print function names to check (in addition to default, see `go tool vet help printf`). + # Default: [] + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + shadow: + # Whether to be strict about shadowing; can be noisy. + # Default: false + strict: true + unusedresult: + # Comma-separated list of functions whose results must be used + # (in addition to default: + # context.WithCancel, context.WithDeadline, context.WithTimeout, context.WithValue, errors.New, fmt.Errorf, + # fmt.Sprint, fmt.Sprintf, sort.Reverse + # ). + # Default: [] + funcs: + - pkg.MyFunc + # Comma-separated list of names of methods of type func() string whose results must be used + # (in addition to default Error,String) + # Default: [] + stringmethods: + - MyMethod + grouper: # Require the use of a single global 'const' declaration only. # Default: false diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index 9b8217fd3d14..6097be06b105 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -598,14 +598,15 @@ type GosmopolitanSettings struct { } type GovetSettings struct { - Go string `mapstructure:"-"` - Settings map[string]map[string]any + Go string `mapstructure:"-"` Enable []string Disable []string EnableAll bool `mapstructure:"enable-all"` DisableAll bool `mapstructure:"disable-all"` + Settings map[string]map[string]any + // Deprecated: the linter should be enabled inside `Enable`. CheckShadowing bool `mapstructure:"check-shadowing"` }