interfacebloat: fix configuration loading (#3194)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
70d595e91d
commit
091d2f4324
@ -62,6 +62,9 @@ var defaultLintersSettings = LintersSettings{
|
||||
MaxDeclLines: 1,
|
||||
MaxDeclChars: 30,
|
||||
},
|
||||
InterfaceBloat: InterfaceBloatSettings{
|
||||
Max: 10,
|
||||
},
|
||||
Lll: LllSettings{
|
||||
LineLength: 120,
|
||||
TabWidth: 1,
|
||||
|
@ -11,10 +11,12 @@ import (
|
||||
func NewInterfaceBloat(settings *config.InterfaceBloatSettings) *goanalysis.Linter {
|
||||
a := analyzer.New()
|
||||
|
||||
cfgMap := make(map[string]map[string]interface{})
|
||||
var cfg map[string]map[string]interface{}
|
||||
if settings != nil {
|
||||
cfgMap[a.Name] = map[string]interface{}{
|
||||
analyzer.InterfaceMaxMethodsFlag: settings.Max,
|
||||
cfg = map[string]map[string]interface{}{
|
||||
a.Name: {
|
||||
analyzer.InterfaceMaxMethodsFlag: settings.Max,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,6 +24,6 @@ func NewInterfaceBloat(settings *config.InterfaceBloatSettings) *goanalysis.Lint
|
||||
a.Name,
|
||||
a.Doc,
|
||||
[]*analysis.Analyzer{a},
|
||||
nil,
|
||||
cfg,
|
||||
).WithLoadMode(goanalysis.LoadModeSyntax)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user