dependabot[bot] f4e33e0bf1
build(deps): bump github.com/kunwardeep/paralleltest from 1.0.9 to 1.0.10 ()
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
2024-02-16 01:05:35 +01:00

35 lines
867 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.NewAnalyzer()
var cfg map[string]map[string]any
if settings != nil {
d := map[string]any{
"i": settings.IgnoreMissing,
"ignoremissingsubtests": settings.IgnoreMissingSubtests,
}
if config.IsGreaterThanOrEqualGo122(settings.Go) {
d["ignoreloopVar"] = true
}
cfg = map[string]map[string]any{a.Name: d}
}
return goanalysis.NewLinter(
a.Name,
"Detects missing usage of t.Parallel() method in your Go test",
[]*analysis.Analyzer{a},
cfg,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}