Skip to content

Commit 3a47f8d

Browse files
committed
contextcheck: remove disable-fact config
1 parent 616395d commit 3a47f8d

File tree

4 files changed

+2
-20
lines changed

4 files changed

+2
-20
lines changed

.golangci.reference.yml

-7
Original file line numberDiff line numberDiff line change
@@ -1847,11 +1847,6 @@ linters-settings:
18471847
# Default: true
18481848
strict-append: true
18491849

1850-
contextcheck:
1851-
# If you use contextcheck in docker ci, and feel a little bit slow, you can turn on this option.
1852-
# Default: false
1853-
disable-fact: true
1854-
18551850
# The custom section can be used to define linter plugins to be loaded at runtime.
18561851
# See README documentation for more info.
18571852
custom:
@@ -1970,7 +1965,6 @@ linters:
19701965
- whitespace
19711966
- wrapcheck
19721967
- wsl
1973-
- contextcheck
19741968

19751969
# Enable all available linters.
19761970
# Default: false
@@ -2073,7 +2067,6 @@ linters:
20732067
- whitespace
20742068
- wrapcheck
20752069
- wsl
2076-
- contextcheck
20772070

20782071
# Enable presets.
20792072
# https://golangci-lint.run/usage/linters

pkg/config/linters_settings.go

-5
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ type LintersSettings struct {
184184
Whitespace WhitespaceSettings
185185
Wrapcheck WrapcheckSettings
186186
WSL WSLSettings
187-
ContextCheck ContextCheckSettings
188187

189188
Custom map[string]CustomLinterSettings
190189
}
@@ -657,10 +656,6 @@ type WSLSettings struct {
657656
ForceCaseTrailingWhitespaceLimit int `mapstructure:"force-case-trailing-whitespace"`
658657
}
659658

660-
type ContextCheckSettings struct {
661-
DisableFact bool `mapstructure:"disable-fact"`
662-
}
663-
664659
// CustomLinterSettings encapsulates the meta-data of a private linter.
665660
// For example, a private linter may be added to the golangci config file as shown below.
666661
//

pkg/golinters/contextcheck.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ import (
44
"github.com/sylvia7788/contextcheck"
55
"golang.org/x/tools/go/analysis"
66

7-
"github.com/golangci/golangci-lint/pkg/config"
87
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
98
"github.com/golangci/golangci-lint/pkg/lint/linter"
109
)
1110

12-
func NewContextCheck(settings *config.ContextCheckSettings) *goanalysis.Linter {
11+
func NewContextCheck() *goanalysis.Linter {
1312
conf := contextcheck.Configuration{}
14-
if settings != nil {
15-
conf.DisableFact = settings.DisableFact
16-
}
1713
analyzer := contextcheck.NewAnalyzer(conf)
1814
return goanalysis.NewLinter(
1915
"contextcheck",

pkg/lint/lintersdb/manager.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
170170
whitespaceCfg *config.WhitespaceSettings
171171
wrapcheckCfg *config.WrapcheckSettings
172172
wslCfg *config.WSLSettings
173-
contextcheckCfg *config.ContextCheckSettings
174173
)
175174

176175
if m.cfg != nil {
@@ -242,7 +241,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
242241
whitespaceCfg = &m.cfg.LintersSettings.Whitespace
243242
wrapcheckCfg = &m.cfg.LintersSettings.Wrapcheck
244243
wslCfg = &m.cfg.LintersSettings.WSL
245-
contextcheckCfg = &m.cfg.LintersSettings.ContextCheck
246244

247245
if govetCfg != nil {
248246
govetCfg.Go = m.cfg.Run.Go
@@ -298,7 +296,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
298296
WithPresets(linter.PresetStyle).
299297
WithURL("https://github.com/sivchari/containedctx"),
300298

301-
linter.NewConfig(golinters.NewContextCheck(contextcheckCfg)).
299+
linter.NewConfig(golinters.NewContextCheck()).
302300
WithSince("v1.43.0").
303301
WithPresets(linter.PresetBugs).
304302
WithLoadForGoAnalysis().

0 commit comments

Comments
 (0)