mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
feat: inactivate deprecated linters (#4436)
This commit is contained in:
parent
3866470d41
commit
a0878087fa
30 changed files with 114 additions and 1360 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue