From 50cfc343c588af802af63dbc468962dfc8996dfd Mon Sep 17 00:00:00 2001 From: Denis Isaev Date: Fri, 4 Oct 2019 11:32:29 +0300 Subject: [PATCH] gocognit: fix default threshold from 0 to 30 --- pkg/config/config.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index d1420a74..117720a3 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -138,9 +138,6 @@ type LintersSettings struct { Gocyclo struct { MinComplexity int `mapstructure:"min-complexity"` } - Gocognit struct { - MinComplexity int `mapstructure:"min-complexity"` - } Varcheck struct { CheckExportedFields bool `mapstructure:"exported-fields"` } @@ -187,6 +184,7 @@ type LintersSettings struct { Gocritic GocriticSettings Godox GodoxSettings Dogsled DogsledSettings + Gocognit GocognitSettings } type GovetSettings struct { @@ -247,6 +245,10 @@ type DogsledSettings struct { MaxBlankIdentifiers int `mapstructure:"max-blank-identifiers"` } +type GocognitSettings struct { + MinComplexity int `mapstructure:"min-complexity"` +} + var defaultLintersSettings = LintersSettings{ Lll: LllSettings{ LineLength: 120, @@ -272,6 +274,9 @@ var defaultLintersSettings = LintersSettings{ Dogsled: DogsledSettings{ MaxBlankIdentifiers: 2, }, + Gocognit: GocognitSettings{ + MinComplexity: 30, + }, } type Linters struct {