feat: inactivate deprecated linters (#4436)

This commit is contained in:
Ludovic Fernandez 2024-03-03 20:40:52 +01:00 committed by GitHub
parent 3866470d41
commit a0878087fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 114 additions and 1360 deletions

View file

@ -3,6 +3,7 @@ package linter
import (
"context"
"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/result"
)
@ -26,6 +27,20 @@ func NewNoop(l Linter, reason string) Noop {
}
}
func NewNoopDeprecated(name string, cfg *config.Config) Noop {
noop := Noop{
name: name,
desc: "Deprecated",
reason: "This linter is fully inactivated: it will not produce any reports.",
}
if cfg.InternalCmdTest {
noop.reason = ""
}
return noop
}
func (n Noop) Run(_ context.Context, lintCtx *Context) ([]result.Issue, error) {
if n.reason != "" {
lintCtx.Log.Warnf("%s: %s", n.name, n.reason)