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

27 lines
601 B
Go

package golinters
import (
mnd "github.com/tommy-muehle/go-mnd/v2"
"golang.org/x/tools/go/analysis"
"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewGoMND(cfg *config.Config) *goanalysis.Linter {
analyzers := []*analysis.Analyzer{
mnd.Analyzer,
}
var linterCfg map[string]map[string]interface{}
if cfg != nil {
linterCfg = cfg.LintersSettings.Gomnd.Settings
}
return goanalysis.NewLinter(
"gomnd",
"An analyzer to detect magic numbers.",
analyzers,
linterCfg,
).WithLoadMode(goanalysis.LoadModeSyntax)
}