golangci-lint/pkg/golinters/paralleltest.go
dependabot[bot] 97eea6ea49
build(deps): bump github.com/kunwardeep/paralleltest from 1.0.4 to 1.0.6 (#2918)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2022-06-12 13:43:23 +02:00

30 lines
738 B
Go

package golinters
import (
"github.com/kunwardeep/paralleltest/pkg/paralleltest"
"golang.org/x/tools/go/analysis"
"github.com/golangci/golangci-lint/pkg/config"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewParallelTest(settings *config.ParallelTestSettings) *goanalysis.Linter {
a := paralleltest.Analyzer
var cfg map[string]map[string]interface{}
if settings != nil {
cfg = map[string]map[string]interface{}{
a.Name: {
"i": settings.IgnoreMissing,
},
}
}
return goanalysis.NewLinter(
"paralleltest",
"paralleltest detects missing usage of t.Parallel() method in your Go test",
[]*analysis.Analyzer{paralleltest.Analyzer},
cfg,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}