plugin: temporarily hide warning about using plugins using the old API (#4002)
Some checks failed
Release a tag / release (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/alpine.Dockerfile]) (push) Has been cancelled

Co-authored-by: Simon Sawert <simon@sawert.se>
This commit is contained in:
Ludovic Fernandez 2023-08-11 12:14:36 +02:00 committed by GitHub
parent 9fc1e20753
commit a9378d9bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {