mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 11:36:29 +00:00
22 lines
590 B
Go
22 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)
|
||
|
}
|