@@ -8,13 +8,16 @@ import (
8
8
)
9
9
10
10
type Manager struct {
11
- nameToLCs map [string ][]* linter.Config
12
- cfg * config.Config
13
- log logutils.Log
11
+ cfg * config.Config
12
+ log logutils.Log
13
+
14
+ nameToLCs map [string ][]* linter.Config
15
+ customLinters []* linter.Config
14
16
}
15
17
16
18
func NewManager (cfg * config.Config , log logutils.Log ) * Manager {
17
19
m := & Manager {cfg : cfg , log : log }
20
+ m .customLinters = m .getCustomLinterConfigs ()
18
21
19
22
nameToLCs := make (map [string ][]* linter.Config )
20
23
for _ , lc := range m .GetAllSupportedLinterConfigs () {
@@ -247,9 +250,12 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
247
250
248
251
const megacheckName = "megacheck"
249
252
253
+ var linters []* linter.Config
254
+ linters = append (linters , m .customLinters ... )
255
+
250
256
// The linters are sorted in the alphabetical order (case-insensitive).
251
257
// When a new linter is added the version in `WithSince(...)` must be the next minor version of golangci-lint.
252
- return [] * linter. Config {
258
+ linters = append ( linters ,
253
259
linter .NewConfig (golinters .NewAsasalint (asasalintCfg )).
254
260
WithSince ("1.47.0" ).
255
261
WithPresets (linter .PresetBugs ).
@@ -867,18 +873,20 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
867
873
WithPresets (linter .PresetStyle ).
868
874
WithURL ("https://github.com/bombsimon/wsl" ),
869
875
876
+ linter .NewConfig (golinters .NewZerologLint ()).
877
+ WithSince ("v1.53.0" ).
878
+ WithPresets (linter .PresetBugs ).
879
+ WithLoadForGoAnalysis ().
880
+ WithURL ("https://github.com/ykadowak/zerologlint" ),
881
+
870
882
// nolintlint must be last because it looks at the results of all the previous linters for unused nolint directives
871
883
linter .NewConfig (golinters .NewNoLintLint (noLintLintCfg )).
872
884
WithSince ("v1.26.0" ).
873
885
WithPresets (linter .PresetStyle ).
874
886
WithURL ("https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md" ),
887
+ )
875
888
876
- linter .NewConfig (golinters .NewZerologLint ()).
877
- WithSince ("v1.53.0" ).
878
- WithPresets (linter .PresetBugs ).
879
- WithLoadForGoAnalysis ().
880
- WithURL ("https://github.com/ykadowak/zerologlint" ),
881
- }
889
+ return linters
882
890
}
883
891
884
892
func (m Manager ) GetAllEnabledByDefaultLinters () []* linter.Config {
0 commit comments