Skip to content

Commit 884cf3d

Browse files
committed
fix: restore some linters
- govet(nilness,unusedwrite) - bodyclose - contextcheck - nilerr - noctx - tparallel
1 parent eddfdbb commit 884cf3d

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

pkg/golinters/govet.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ func analyzersFromConfig(settings *config.GovetSettings) []*analysis.Analyzer {
155155
}
156156

157157
func isAnalyzerEnabled(name string, cfg *config.GovetSettings, defaultAnalyzers []*analysis.Analyzer) bool {
158-
if (name == nilness.Analyzer.Name || name == unusedwrite.Analyzer.Name) &&
159-
config.IsGreaterThanOrEqualGo118(cfg.Go) {
160-
return false
161-
}
162-
163158
if cfg.EnableAll {
164159
for _, n := range cfg.Disable {
165160
if n == name {

pkg/lint/lintersdb/manager.go

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
288288
WithSince("v1.18.0").
289289
WithLoadForGoAnalysis().
290290
WithPresets(linter.PresetPerformance, linter.PresetBugs).
291-
WithURL("https://github.com/timakin/bodyclose").
292-
WithNoopFallback(m.cfg),
291+
WithURL("https://github.com/timakin/bodyclose"),
293292

294293
linter.NewConfig(golinters.NewContainedCtx()).
295294
WithSince("1.44.0").
@@ -300,8 +299,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
300299
WithSince("v1.43.0").
301300
WithPresets(linter.PresetBugs).
302301
WithLoadForGoAnalysis().
303-
WithURL("https://github.com/sylvia7788/contextcheck").
304-
WithNoopFallback(m.cfg),
302+
WithURL("https://github.com/sylvia7788/contextcheck"),
305303

306304
linter.NewConfig(golinters.NewCyclop(cyclopCfg)).
307305
WithSince("v1.37.0").
@@ -561,8 +559,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
561559
WithLoadForGoAnalysis().
562560
WithPresets(linter.PresetStyle).
563561
WithURL("https://github.com/mvdan/interfacer").
564-
Deprecated("The repository of the linter has been archived by the owner.", "v1.38.0", "").
565-
WithNoopFallback(m.cfg),
562+
Deprecated("The repository of the linter has been archived by the owner.", "v1.38.0", ""),
566563

567564
linter.NewConfig(golinters.NewIreturn(ireturnCfg)).
568565
WithSince("v1.43.0").
@@ -612,8 +609,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
612609
WithSince("v1.38.0").
613610
WithLoadForGoAnalysis().
614611
WithPresets(linter.PresetBugs).
615-
WithURL("https://github.com/gostaticanalysis/nilerr").
616-
WithNoopFallback(m.cfg),
612+
WithURL("https://github.com/gostaticanalysis/nilerr"),
617613

618614
linter.NewConfig(golinters.NewNilNil(nilNilCfg)).
619615
WithSince("v1.43.0").
@@ -630,8 +626,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
630626
WithSince("v1.28.0").
631627
WithLoadForGoAnalysis().
632628
WithPresets(linter.PresetPerformance, linter.PresetBugs).
633-
WithURL("https://github.com/sonatard/noctx").
634-
WithNoopFallback(m.cfg),
629+
WithURL("https://github.com/sonatard/noctx"),
635630

636631
linter.NewConfig(golinters.NewNoNamedReturns(noNamedReturnsCfg)).
637632
WithSince("v1.46.0").
@@ -680,8 +675,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
680675
WithSince("v1.23.0").
681676
WithLoadForGoAnalysis().
682677
WithPresets(linter.PresetBugs, linter.PresetSQL).
683-
WithURL("https://github.com/jingyugao/rowserrcheck").
684-
WithNoopFallback(m.cfg),
678+
WithURL("https://github.com/jingyugao/rowserrcheck"),
685679

686680
linter.NewConfig(golinters.NewScopelint()).
687681
WithSince("v1.12.0").
@@ -693,8 +687,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
693687
WithSince("v1.28.0").
694688
WithPresets(linter.PresetBugs, linter.PresetSQL).
695689
WithLoadForGoAnalysis().
696-
WithURL("https://github.com/ryanrolds/sqlclosecheck").
697-
WithNoopFallback(m.cfg),
690+
WithURL("https://github.com/ryanrolds/sqlclosecheck"),
698691

699692
linter.NewConfig(golinters.NewStaticcheck(staticcheckCfg)).
700693
WithSince("v1.0.0").
@@ -707,8 +700,8 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
707700
WithSince("v1.0.0").
708701
WithLoadForGoAnalysis().
709702
WithPresets(linter.PresetUnused).
710-
WithURL("https://github.com/opennota/check").
711-
WithNoopFallback(m.cfg),
703+
WithURL("https://github.com/opennota/check"),
704+
// WithNoopFallback(m.cfg),
712705

713706
linter.NewConfig(golinters.NewStylecheck(stylecheckCfg)).
714707
WithSince("v1.20.0").
@@ -742,8 +735,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
742735
WithSince("v1.32.0").
743736
WithPresets(linter.PresetStyle, linter.PresetTest).
744737
WithLoadForGoAnalysis().
745-
WithURL("https://github.com/moricho/tparallel").
746-
WithNoopFallback(m.cfg),
738+
WithURL("https://github.com/moricho/tparallel"),
747739

748740
linter.NewConfig(golinters.NewTypecheck()).
749741
WithSince("v1.3.0").
@@ -788,8 +780,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
788780
WithSince("v1.38.0").
789781
WithPresets(linter.PresetStyle).
790782
WithLoadForGoAnalysis().
791-
WithURL("https://github.com/sanposhiho/wastedassign").
792-
WithNoopFallback(m.cfg),
783+
WithURL("https://github.com/sanposhiho/wastedassign"),
793784

794785
linter.NewConfig(golinters.NewWhitespace(whitespaceCfg)).
795786
WithSince("v1.19.0").

0 commit comments

Comments
 (0)