From 105da96946b29e713e9df79673aaa98b6e771f90 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 11 Aug 2023 10:50:41 +0200 Subject: [PATCH 1/3] chore: hide warning --- pkg/lint/lintersdb/custom_linters.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/lint/lintersdb/custom_linters.go b/pkg/lint/lintersdb/custom_linters.go index bb1c61c0545f..fd631c4642bf 100644 --- a/pkg/lint/lintersdb/custom_linters.go +++ b/pkg/lint/lintersdb/custom_linters.go @@ -2,6 +2,7 @@ package lintersdb import ( "fmt" + "os" "path/filepath" "plugin" @@ -115,8 +116,11 @@ func (m *Manager) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyze return nil, err } - m.log.Warnf("plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: " + - "https://golangci-lint.run/contributing/new-linters/#create-a-plugin") + // TODO(ldez): remove this env var in the next minor version (v1.55.0) + if os.Getenv("GOLANGCI_LINT_HIDE_WARNING_ABOUT_PLUGIN_API_DEPRECATION") != "1" { + m.log.Warnf("plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: " + + "https://golangci-lint.run/contributing/new-linters/#create-a-plugin") + } analyzerPlugin, ok := symbol.(AnalyzerPlugin) if !ok { From e825078be4c2c776a35baca5c1020eb4dc3980e7 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 11 Aug 2023 11:14:10 +0200 Subject: [PATCH 2/3] Update pkg/lint/lintersdb/custom_linters.go Co-authored-by: Simon Sawert --- pkg/lint/lintersdb/custom_linters.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/lint/lintersdb/custom_linters.go b/pkg/lint/lintersdb/custom_linters.go index fd631c4642bf..bca1da1c61d2 100644 --- a/pkg/lint/lintersdb/custom_linters.go +++ b/pkg/lint/lintersdb/custom_linters.go @@ -117,7 +117,7 @@ func (m *Manager) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyze } // TODO(ldez): remove this env var in the next minor version (v1.55.0) - if os.Getenv("GOLANGCI_LINT_HIDE_WARNING_ABOUT_PLUGIN_API_DEPRECATION") != "1" { + if _, ok := os. LookupEnv("GOLANGCI_LINT_HIDE_WARNING_ABOUT_PLUGIN_API_DEPRECATION"); !ok { m.log.Warnf("plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: " + "https://golangci-lint.run/contributing/new-linters/#create-a-plugin") } From 06af7c4b9d8fa9916a9bf77596181b21aba75d55 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 11 Aug 2023 11:16:59 +0200 Subject: [PATCH 3/3] chore: improve todo --- pkg/lint/lintersdb/custom_linters.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/lint/lintersdb/custom_linters.go b/pkg/lint/lintersdb/custom_linters.go index bca1da1c61d2..d0eaa7905fb0 100644 --- a/pkg/lint/lintersdb/custom_linters.go +++ b/pkg/lint/lintersdb/custom_linters.go @@ -116,8 +116,8 @@ func (m *Manager) lookupAnalyzerPlugin(plug *plugin.Plugin) ([]*analysis.Analyze return nil, err } - // TODO(ldez): remove this env var in the next minor version (v1.55.0) - if _, ok := os. LookupEnv("GOLANGCI_LINT_HIDE_WARNING_ABOUT_PLUGIN_API_DEPRECATION"); !ok { + // TODO(ldez): remove this env var (but keep the log) in the next minor version (v1.55.0) + if _, ok := os.LookupEnv("GOLANGCI_LINT_HIDE_WARNING_ABOUT_PLUGIN_API_DEPRECATION"); !ok { m.log.Warnf("plugin: 'AnalyzerPlugin' plugins are deprecated, please use the new plugin signature: " + "https://golangci-lint.run/contributing/new-linters/#create-a-plugin") }