File tree Expand file tree Collapse file tree 5 files changed +15
-5
lines changed Expand file tree Collapse file tree 5 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -1340,6 +1340,10 @@ linters-settings:
13401340 # Ignore missing calls to `t.Parallel()` and only report incorrect uses of it.
13411341 # Default: false
13421342 ignore-missing : true
1343+ # Ignore missing calls to `t.Parallel()` in subtests. Top-level tests are
1344+ # still required to have `t.Parallel`, but subtests are allowed to skip it.
1345+ # Default: false
1346+ ignore-missing-subtests : true
13431347
13441348 prealloc :
13451349 # IMPORTANT: we don't recommend using this linter before doing performance profiling.
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ require (
5858 github.com/kisielk/errcheck v1.6.3
5959 github.com/kkHAIKE/contextcheck v1.1.4
6060 github.com/kulti/thelper v0.6.3
61- github.com/kunwardeep/paralleltest v1.0.7
61+ github.com/kunwardeep/paralleltest v1.0.8
6262 github.com/kyoh86/exportloopref v0.1.11
6363 github.com/ldez/gomoddirectives v0.2.3
6464 github.com/ldez/tagliatelle v0.5.0
@@ -117,7 +117,7 @@ require (
117117 gitlab.com/bosi/decorder v0.4.0
118118 go.tmz.dev/musttag v0.7.1
119119 golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
120- golang.org/x/tools v0.11.0
120+ golang.org/x/tools v0.11.1
121121 gopkg.in/yaml.v3 v3.0.1
122122 honnef.co/go/tools v0.4.3
123123 mvdan.cc/gofumpt v0.5.0
Original file line number Diff line number Diff line change @@ -655,7 +655,8 @@ type NoNamedReturnsSettings struct {
655655 ReportErrorInDefer bool `mapstructure:"report-error-in-defer"`
656656}
657657type ParallelTestSettings struct {
658- IgnoreMissing bool `mapstructure:"ignore-missing"`
658+ IgnoreMissing bool `mapstructure:"ignore-missing"`
659+ IgnoreMissingSubtests bool `mapstructure:"ignore-missing-subtests"`
659660}
660661
661662type PreallocSettings struct {
Original file line number Diff line number Diff line change @@ -9,13 +9,14 @@ import (
99)
1010
1111func NewParallelTest (settings * config.ParallelTestSettings ) * goanalysis.Linter {
12- a := paralleltest .Analyzer
12+ a := paralleltest .NewAnalyzer ()
1313
1414 var cfg map [string ]map [string ]any
1515 if settings != nil {
1616 cfg = map [string ]map [string ]any {
1717 a .Name : {
18- "i" : settings .IgnoreMissing ,
18+ "i" : settings .IgnoreMissing ,
19+ "ignoremissingsubtests" : settings .IgnoreMissingSubtests ,
1920 },
2021 }
2122 }
You can’t perform that action at this time.
0 commit comments