Skip to content

Commit 97eea6e

Browse files
build(deps): bump github.com/kunwardeep/paralleltest from 1.0.4 to 1.0.6 (#2918)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent c766184 commit 97eea6e

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
@@ -1152,6 +1152,11 @@ linters-settings:
11521152
# Default: false
11531153
require-specific: true
11541154

1155+
paralleltest:
1156+
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
1157+
# Default: false
1158+
ignore-missing: true
1159+
11551160
prealloc:
11561161
# IMPORTANT: we don't recommend using this linter before doing performance profiling.
11571162
# 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)