From a9378d9bb87e3d5952a7586d1008c6fac3ebd764 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 11 Aug 2023 12:14:36 +0200 Subject: [PATCH] plugin: temporarily hide warning about using plugins using the old API (#4002) Co-authored-by: Simon Sawert --- 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 bb1c61c0..d0eaa790 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 (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") + } analyzerPlugin, ok := symbol.(AnalyzerPlugin) if !ok {