woodpecker/vendor/github.com/golangci/golangci-lint/pkg/golinters/staticcheck.go
Lukas c28f7cb29f
Add golangci-lint (#502)
Initial part of #435
2021-11-14 21:01:54 +01:00

21 lines
590 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",
"Staticcheck is a go vet on steroids, applying a ton of static analysis checks",
analyzers,
nil,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}