File tree 4 files changed +13
-9
lines changed
4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ require (
91
91
github.com/ssgreg/nlreturn/v2 v2.2.1
92
92
github.com/stbenjam/no-sprintf-host-port v0.1.1
93
93
github.com/stretchr/testify v1.8.0
94
- github.com/sylvia7788/contextcheck v1.0.4
94
+ github.com/sylvia7788/contextcheck v1.0.6
95
95
github.com/tdakkota/asciicheck v0.1.1
96
96
github.com/tetafro/godot v1.4.11
97
97
github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144
Original file line number Diff line number Diff line change @@ -5,13 +5,18 @@ import (
5
5
"golang.org/x/tools/go/analysis"
6
6
7
7
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
8
+ "github.com/golangci/golangci-lint/pkg/lint/linter"
8
9
)
9
10
10
11
func NewContextCheck () * goanalysis.Linter {
12
+ analyzer := contextcheck .NewAnalyzer (contextcheck.Configuration {})
13
+
11
14
return goanalysis .NewLinter (
12
- "contextcheck" ,
13
- "check the function whether use a non-inherited context" ,
14
- []* analysis.Analyzer {contextcheck . NewAnalyzer () },
15
+ analyzer . Name ,
16
+ analyzer . Doc ,
17
+ []* analysis.Analyzer {analyzer },
15
18
nil ,
16
- ).WithLoadMode (goanalysis .LoadModeTypesInfo )
19
+ ).WithContextSetter (func (lintCtx * linter.Context ) {
20
+ analyzer .Run = contextcheck .NewRun (lintCtx .Packages , false )
21
+ }).WithLoadMode (goanalysis .LoadModeTypesInfo )
17
22
}
Original file line number Diff line number Diff line change @@ -304,8 +304,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
304
304
WithSince ("v1.43.0" ).
305
305
WithPresets (linter .PresetBugs ).
306
306
WithLoadForGoAnalysis ().
307
- WithURL ("https://github.com/sylvia7788/contextcheck" ).
308
- WithNoopFallback (m .cfg ),
307
+ WithURL ("https://github.com/sylvia7788/contextcheck" ),
309
308
310
309
linter .NewConfig (golinters .NewCyclop (cyclopCfg )).
311
310
WithSince ("v1.37.0" ).
You can’t perform that action at this time.
0 commit comments