Skip to content

build(deps): bump github.com/kunwardeep/paralleltest from 1.0.4 to 1.0.6 #2918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
@@ -1152,6 +1152,11 @@ linters-settings:
# Default: false
require-specific: true

paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
# Default: false
ignore-missing: true

prealloc:
# IMPORTANT: we don't recommend using this linter before doing performance profiling.
# For most programs usage of prealloc will be a premature optimization.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ require (
github.com/julz/importas v0.1.0
github.com/kisielk/errcheck v1.6.1
github.com/kulti/thelper v0.6.3
github.com/kunwardeep/paralleltest v1.0.4
github.com/kunwardeep/paralleltest v1.0.6
github.com/kyoh86/exportloopref v0.1.8
github.com/ldez/gomoddirectives v0.2.3
github.com/ldez/tagliatelle v0.3.1
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
@@ -158,6 +158,7 @@ type LintersSettings struct {
NilNil NilNilSettings
Nlreturn NlreturnSettings
NoLintLint NoLintLintSettings
ParallelTest ParallelTestSettings
Prealloc PreallocSettings
Predeclared PredeclaredSettings
Promlinter PromlinterSettings
@@ -481,6 +482,10 @@ type NoLintLintSettings struct {
AllowUnused bool `mapstructure:"allow-unused"`
}

type ParallelTestSettings struct {
IgnoreMissing bool `mapstructure:"ignore-missing"`
}

type PreallocSettings struct {
Simple bool
RangeLoops bool `mapstructure:"range-loops"`
18 changes: 15 additions & 3 deletions pkg/golinters/paralleltest.go
Original file line number Diff line number Diff line change
@@ -4,14 +4,26 @@ 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() *goanalysis.Linter {
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.NewAnalyzer()},
nil,
[]*analysis.Analyzer{paralleltest.Analyzer},
cfg,
).WithLoadMode(goanalysis.LoadModeTypesInfo)
}
4 changes: 3 additions & 1 deletion pkg/lint/lintersdb/manager.go
Original file line number Diff line number Diff line change
@@ -147,6 +147,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
nilNilCfg *config.NilNilSettings
nlreturnCfg *config.NlreturnSettings
noLintLintCfg *config.NoLintLintSettings
parallelTestCfg *config.ParallelTestSettings
preallocCfg *config.PreallocSettings
predeclaredCfg *config.PredeclaredSettings
promlinterCfg *config.PromlinterSettings
@@ -216,6 +217,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
nlreturnCfg = &m.cfg.LintersSettings.Nlreturn
noLintLintCfg = &m.cfg.LintersSettings.NoLintLint
preallocCfg = &m.cfg.LintersSettings.Prealloc
parallelTestCfg = &m.cfg.LintersSettings.ParallelTest
predeclaredCfg = &m.cfg.LintersSettings.Predeclared
promlinterCfg = &m.cfg.LintersSettings.Promlinter
reviveCfg = &m.cfg.LintersSettings.Revive
@@ -614,7 +616,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
WithPresets(linter.PresetStyle).
WithURL("https://github.com/stbenjam/no-sprintf-host-port"),

linter.NewConfig(golinters.NewParallelTest()).
linter.NewConfig(golinters.NewParallelTest(parallelTestCfg)).
WithSince("v1.33.0").
WithLoadForGoAnalysis().
WithPresets(linter.PresetStyle, linter.PresetTest).