Skip to content

Commit 94a9c43

Browse files
sylvia7788ldez
authored andcommitted
contextcheck: remove disable-fact config
1 parent b6b99b5 commit 94a9c43

File tree

4 files changed

+2
-20
lines changed

4 files changed

+2
-20
lines changed

.golangci.reference.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,11 +1854,6 @@ linters-settings:
18541854
# Default: true
18551855
strict-append: true
18561856

1857-
contextcheck:
1858-
# If you use contextcheck in docker ci, and feel a little bit slow, you can turn on this option.
1859-
# Default: false
1860-
disable-fact: true
1861-
18621857
# The custom section can be used to define linter plugins to be loaded at runtime.
18631858
# See README documentation for more info.
18641859
custom:
@@ -1979,7 +1974,6 @@ linters:
19791974
- whitespace
19801975
- wrapcheck
19811976
- wsl
1982-
- contextcheck
19831977

19841978
# Enable all available linters.
19851979
# Default: false
@@ -2084,7 +2078,6 @@ linters:
20842078
- whitespace
20852079
- wrapcheck
20862080
- wsl
2087-
- contextcheck
20882081

20892082
# Enable presets.
20902083
# https://golangci-lint.run/usage/linters

pkg/config/linters_settings.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ type LintersSettings struct {
185185
Whitespace WhitespaceSettings
186186
Wrapcheck WrapcheckSettings
187187
WSL WSLSettings
188-
ContextCheck ContextCheckSettings
189188

190189
Custom map[string]CustomLinterSettings
191190
}
@@ -662,10 +661,6 @@ type WSLSettings struct {
662661
ForceCaseTrailingWhitespaceLimit int `mapstructure:"force-case-trailing-whitespace"`
663662
}
664663

665-
type ContextCheckSettings struct {
666-
DisableFact bool `mapstructure:"disable-fact"`
667-
}
668-
669664
// CustomLinterSettings encapsulates the meta-data of a private linter.
670665
// For example, a private linter may be added to the golangci config file as shown below.
671666
//

pkg/golinters/contextcheck.go

Lines changed: 1 addition & 5 deletions
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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
171171
whitespaceCfg *config.WhitespaceSettings
172172
wrapcheckCfg *config.WrapcheckSettings
173173
wslCfg *config.WSLSettings
174-
contextcheckCfg *config.ContextCheckSettings
175174
)
176175

177176
if m.cfg != nil {
@@ -244,7 +243,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
244243
whitespaceCfg = &m.cfg.LintersSettings.Whitespace
245244
wrapcheckCfg = &m.cfg.LintersSettings.Wrapcheck
246245
wslCfg = &m.cfg.LintersSettings.WSL
247-
contextcheckCfg = &m.cfg.LintersSettings.ContextCheck
248246

249247
if govetCfg != nil {
250248
govetCfg.Go = m.cfg.Run.Go
@@ -300,7 +298,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
300298
WithPresets(linter.PresetStyle).
301299
WithURL("https://github.com/sivchari/containedctx"),
302300

303-
linter.NewConfig(golinters.NewContextCheck(contextcheckCfg)).
301+
linter.NewConfig(golinters.NewContextCheck()).
304302
WithSince("v1.43.0").
305303
WithPresets(linter.PresetBugs).
306304
WithLoadForGoAnalysis().

0 commit comments

Comments
 (0)