@@ -113,6 +113,10 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
113
113
var goModDirectivesCfg * config.GoModDirectivesSettings
114
114
var tagliatelleCfg * config.TagliatelleSettings
115
115
var gosecCfg * config.GoSecSettings
116
+ var gosimpleCfg * config.StaticCheckSettings
117
+ var staticcheckCfg * config.StaticCheckSettings
118
+ var stylecheckCfg * config.StaticCheckSettings
119
+ var unusedCfg * config.StaticCheckSettings
116
120
117
121
if m .cfg != nil {
118
122
govetCfg = & m .cfg .LintersSettings .Govet
@@ -129,6 +133,10 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
129
133
goModDirectivesCfg = & m .cfg .LintersSettings .GoModDirectives
130
134
tagliatelleCfg = & m .cfg .LintersSettings .Tagliatelle
131
135
gosecCfg = & m .cfg .LintersSettings .Gosec
136
+ gosimpleCfg = & m .cfg .LintersSettings .Gosimple
137
+ staticcheckCfg = & m .cfg .LintersSettings .Staticcheck
138
+ stylecheckCfg = & m .cfg .LintersSettings .Stylecheck
139
+ unusedCfg = & m .cfg .LintersSettings .Unused
132
140
}
133
141
134
142
const megacheckName = "megacheck"
@@ -166,28 +174,28 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
166
174
WithPresets (linter .PresetBugs , linter .PresetSQL ).
167
175
WithURL ("https://github.com/jingyugao/rowserrcheck" ),
168
176
169
- linter .NewConfig (golinters .NewStaticcheck ()).
177
+ linter .NewConfig (golinters .NewStaticcheck (staticcheckCfg )).
170
178
WithSince ("v1.0.0" ).
171
179
WithLoadForGoAnalysis ().
172
180
WithPresets (linter .PresetBugs , linter .PresetMetaLinter ).
173
181
WithAlternativeNames (megacheckName ).
174
182
WithURL ("https://staticcheck.io/" ),
175
- linter .NewConfig (golinters .NewUnused ()).
183
+ linter .NewConfig (golinters .NewUnused (unusedCfg )).
176
184
WithSince ("v1.20.0" ).
177
185
WithLoadForGoAnalysis ().
178
186
WithPresets (linter .PresetUnused ).
179
187
WithAlternativeNames (megacheckName ).
180
188
ConsiderSlow ().
181
189
WithChangeTypes ().
182
190
WithURL ("https://github.com/dominikh/go-tools/tree/master/unused" ),
183
- linter .NewConfig (golinters .NewGosimple ()).
191
+ linter .NewConfig (golinters .NewGosimple (gosimpleCfg )).
184
192
WithSince ("v1.20.0" ).
185
193
WithLoadForGoAnalysis ().
186
194
WithPresets (linter .PresetStyle ).
187
195
WithAlternativeNames (megacheckName ).
188
196
WithURL ("https://github.com/dominikh/go-tools/tree/master/simple" ),
189
197
190
- linter .NewConfig (golinters .NewStylecheck ()).
198
+ linter .NewConfig (golinters .NewStylecheck (stylecheckCfg )).
191
199
WithSince ("v1.20.0" ).
192
200
WithLoadForGoAnalysis ().
193
201
WithPresets (linter .PresetStyle ).
@@ -499,16 +507,16 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
499
507
}
500
508
501
509
enabledByDefault := map [string ]bool {
502
- golinters .NewGovet (nil ).Name (): true ,
503
- golinters .NewErrcheck ().Name (): true ,
504
- golinters .NewStaticcheck ().Name (): true ,
505
- golinters .NewUnused ().Name (): true ,
506
- golinters .NewGosimple ().Name (): true ,
507
- golinters .NewStructcheck ().Name (): true ,
508
- golinters .NewVarcheck ().Name (): true ,
509
- golinters .NewIneffassign ().Name (): true ,
510
- golinters .NewDeadcode ().Name (): true ,
511
- golinters .NewTypecheck ().Name (): true ,
510
+ golinters .NewGovet (nil ).Name (): true ,
511
+ golinters .NewErrcheck ().Name (): true ,
512
+ golinters .NewStaticcheck (staticcheckCfg ).Name (): true ,
513
+ golinters .NewUnused (unusedCfg ).Name (): true ,
514
+ golinters .NewGosimple (gosimpleCfg ).Name (): true ,
515
+ golinters .NewStructcheck ().Name (): true ,
516
+ golinters .NewVarcheck ().Name (): true ,
517
+ golinters .NewIneffassign ().Name (): true ,
518
+ golinters .NewDeadcode ().Name (): true ,
519
+ golinters .NewTypecheck ().Name (): true ,
512
520
}
513
521
return enableLinterConfigs (lcs , func (lc * linter.Config ) bool {
514
522
return enabledByDefault [lc .Name ()]
0 commit comments