diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 54c1672a1dd8..46fd2df5adea 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -1847,11 +1847,6 @@ linters-settings: # Default: true strict-append: true - contextcheck: - # If you use contextcheck in docker ci, and feel a little bit slow, you can turn on this option. - # Default: false - disable-fact: true - # The custom section can be used to define linter plugins to be loaded at runtime. # See README documentation for more info. custom: @@ -1970,7 +1965,6 @@ linters: - whitespace - wrapcheck - wsl - - contextcheck # Enable all available linters. # Default: false @@ -2073,7 +2067,6 @@ linters: - whitespace - wrapcheck - wsl - - contextcheck # Enable presets. # https://golangci-lint.run/usage/linters diff --git a/pkg/config/linters_settings.go b/pkg/config/linters_settings.go index e22a7e2d4ede..1e923409a05d 100644 --- a/pkg/config/linters_settings.go +++ b/pkg/config/linters_settings.go @@ -184,7 +184,6 @@ type LintersSettings struct { Whitespace WhitespaceSettings Wrapcheck WrapcheckSettings WSL WSLSettings - ContextCheck ContextCheckSettings Custom map[string]CustomLinterSettings } @@ -657,10 +656,6 @@ type WSLSettings struct { ForceCaseTrailingWhitespaceLimit int `mapstructure:"force-case-trailing-whitespace"` } -type ContextCheckSettings struct { - DisableFact bool `mapstructure:"disable-fact"` -} - // CustomLinterSettings encapsulates the meta-data of a private linter. // For example, a private linter may be added to the golangci config file as shown below. // diff --git a/pkg/golinters/contextcheck.go b/pkg/golinters/contextcheck.go index 3254935712e9..bfc55d250d2a 100644 --- a/pkg/golinters/contextcheck.go +++ b/pkg/golinters/contextcheck.go @@ -4,16 +4,12 @@ import ( "github.com/sylvia7788/contextcheck" "golang.org/x/tools/go/analysis" - "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" ) -func NewContextCheck(settings *config.ContextCheckSettings) *goanalysis.Linter { +func NewContextCheck() *goanalysis.Linter { conf := contextcheck.Configuration{} - if settings != nil { - conf.DisableFact = settings.DisableFact - } analyzer := contextcheck.NewAnalyzer(conf) return goanalysis.NewLinter( "contextcheck", diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index cbf0bfa18430..20f06c93991f 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -170,7 +170,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { whitespaceCfg *config.WhitespaceSettings wrapcheckCfg *config.WrapcheckSettings wslCfg *config.WSLSettings - contextcheckCfg *config.ContextCheckSettings ) if m.cfg != nil { @@ -242,7 +241,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { whitespaceCfg = &m.cfg.LintersSettings.Whitespace wrapcheckCfg = &m.cfg.LintersSettings.Wrapcheck wslCfg = &m.cfg.LintersSettings.WSL - contextcheckCfg = &m.cfg.LintersSettings.ContextCheck if govetCfg != nil { govetCfg.Go = m.cfg.Run.Go @@ -298,7 +296,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithPresets(linter.PresetStyle). WithURL("https://github.com/sivchari/containedctx"), - linter.NewConfig(golinters.NewContextCheck(contextcheckCfg)). + linter.NewConfig(golinters.NewContextCheck()). WithSince("v1.43.0"). WithPresets(linter.PresetBugs). WithLoadForGoAnalysis().