Skip to content

Commit 6f89d89

Browse files
dependabot[bot]ldez
authored andcommitted
build(deps): bump github.com/kunwardeep/paralleltest from 1.0.4 to 1.0.6 (golangci#2918)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 68ef611 commit 6f89d89

File tree

6 files changed

+31
-7
lines changed

6 files changed

+31
-7
lines changed

.golangci.reference.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,11 @@ linters-settings:
11771177
# Default: false
11781178
require-specific: true
11791179

1180+
paralleltest:
1181+
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
1182+
# Default: false
1183+
ignore-missing: true
1184+
11801185
prealloc:
11811186
# IMPORTANT: we don't recommend using this linter before doing performance profiling.
11821187
# For most programs usage of prealloc will be a premature optimization.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ require (
4949
github.com/julz/importas v0.1.0
5050
github.com/kisielk/errcheck v1.6.1
5151
github.com/kulti/thelper v0.6.3
52-
github.com/kunwardeep/paralleltest v1.0.4
52+
github.com/kunwardeep/paralleltest v1.0.6
5353
github.com/kyoh86/exportloopref v0.1.8
5454
github.com/ldez/gomoddirectives v0.2.3
5555
github.com/ldez/tagliatelle v0.3.1

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

+5
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ type LintersSettings struct {
158158
NilNil NilNilSettings
159159
Nlreturn NlreturnSettings
160160
NoLintLint NoLintLintSettings
161+
ParallelTest ParallelTestSettings
161162
Prealloc PreallocSettings
162163
Predeclared PredeclaredSettings
163164
Promlinter PromlinterSettings
@@ -481,6 +482,10 @@ type NoLintLintSettings struct {
481482
AllowUnused bool `mapstructure:"allow-unused"`
482483
}
483484

485+
type ParallelTestSettings struct {
486+
IgnoreMissing bool `mapstructure:"ignore-missing"`
487+
}
488+
484489
type PreallocSettings struct {
485490
Simple bool
486491
RangeLoops bool `mapstructure:"range-loops"`

pkg/golinters/paralleltest.go

+15-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@ import (
44
"github.com/kunwardeep/paralleltest/pkg/paralleltest"
55
"golang.org/x/tools/go/analysis"
66

7+
"github.com/golangci/golangci-lint/pkg/config"
78
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
89
)
910

10-
func NewParallelTest() *goanalysis.Linter {
11+
func NewParallelTest(settings *config.ParallelTestSettings) *goanalysis.Linter {
12+
a := paralleltest.Analyzer
13+
14+
var cfg map[string]map[string]interface{}
15+
if settings != nil {
16+
cfg = map[string]map[string]interface{}{
17+
a.Name: {
18+
"i": settings.IgnoreMissing,
19+
},
20+
}
21+
}
22+
1123
return goanalysis.NewLinter(
1224
"paralleltest",
1325
"paralleltest detects missing usage of t.Parallel() method in your Go test",
14-
[]*analysis.Analyzer{paralleltest.NewAnalyzer()},
15-
nil,
26+
[]*analysis.Analyzer{paralleltest.Analyzer},
27+
cfg,
1628
).WithLoadMode(goanalysis.LoadModeTypesInfo)
1729
}

pkg/lint/lintersdb/manager.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
147147
nilNilCfg *config.NilNilSettings
148148
nlreturnCfg *config.NlreturnSettings
149149
noLintLintCfg *config.NoLintLintSettings
150+
parallelTestCfg *config.ParallelTestSettings
150151
preallocCfg *config.PreallocSettings
151152
predeclaredCfg *config.PredeclaredSettings
152153
promlinterCfg *config.PromlinterSettings
@@ -216,6 +217,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
216217
nlreturnCfg = &m.cfg.LintersSettings.Nlreturn
217218
noLintLintCfg = &m.cfg.LintersSettings.NoLintLint
218219
preallocCfg = &m.cfg.LintersSettings.Prealloc
220+
parallelTestCfg = &m.cfg.LintersSettings.ParallelTest
219221
predeclaredCfg = &m.cfg.LintersSettings.Predeclared
220222
promlinterCfg = &m.cfg.LintersSettings.Promlinter
221223
reviveCfg = &m.cfg.LintersSettings.Revive
@@ -614,7 +616,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
614616
WithPresets(linter.PresetStyle).
615617
WithURL("https://github.com/stbenjam/no-sprintf-host-port"),
616618

617-
linter.NewConfig(golinters.NewParallelTest()).
619+
linter.NewConfig(golinters.NewParallelTest(parallelTestCfg)).
618620
WithSince("v1.33.0").
619621
WithLoadForGoAnalysis().
620622
WithPresets(linter.PresetStyle, linter.PresetTest).

0 commit comments

Comments
 (0)