golangci-lint/pkg/golinters/staticcheck.go
Ludovic Fernandez 091a641f91
docs: have a clear explanation about the staticcheck integration. (#2894)
docs: have a clear state about staticcheck
2022-06-06 13:19:33 +02:00

23 lines
719 B
Go

package golinters
import (
"honnef.co/go/tools/staticcheck"
"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewStaticcheck(settings *config.StaticCheckSettings) *goanalysis.Linter {
cfg := staticCheckConfig(settings)
analyzers := setupStaticCheckAnalyzers(staticcheck.Analyzers, getGoVersion(settings), cfg.Checks)
return goanalysis.NewLinter(
"staticcheck",
"It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary."+
" The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint.",
analyzers,
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}