Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jan 25, 2022
1 parent fbbfdef commit 6b0798c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
15 changes: 6 additions & 9 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,14 @@ func (cfg GovetSettings) Validate() error {
}

type GrouperSettings struct {
ConstRequireSingleConst bool `mapstructure:"const-require-single-const"`
ConstRequireGrouping bool `mapstructure:"const-require-grouping"`

ConstRequireSingleConst bool `mapstructure:"const-require-single-const"`
ConstRequireGrouping bool `mapstructure:"const-require-grouping"`
ImportRequireSingleImport bool `mapstructure:"import-require-single-import"`
ImportRequireGrouping bool `mapstructure:"import-require-grouping"`

TypeRequireSingleType bool `mapstructure:"type-require-single-type"`
TypeRequireGrouping bool `mapstructure:"type-require-grouping"`

VarRequireSingleVar bool `mapstructure:"var-require-single-var"`
VarRequireGrouping bool `mapstructure:"var-require-grouping"`
TypeRequireSingleType bool `mapstructure:"type-require-single-type"`
TypeRequireGrouping bool `mapstructure:"type-require-grouping"`
VarRequireSingleVar bool `mapstructure:"var-require-single-var"`
VarRequireGrouping bool `mapstructure:"var-require-grouping"`
}

type IfshortSettings struct {
Expand Down
15 changes: 6 additions & 9 deletions pkg/golinters/grouper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@ func NewGrouper(settings *config.GrouperSettings) *goanalysis.Linter {
linterCfg := map[string]map[string]interface{}{}
if settings != nil {
linterCfg["grouper"] = map[string]interface{}{
"const-require-single-const": settings.ConstRequireSingleConst,
"const-require-grouping": settings.ConstRequireGrouping,

"const-require-single-const": settings.ConstRequireSingleConst,
"const-require-grouping": settings.ConstRequireGrouping,
"import-require-single-import": settings.ImportRequireSingleImport,
"import-require-grouping": settings.ImportRequireGrouping,

"type-require-single-type": settings.TypeRequireSingleType,
"type-require-grouping": settings.TypeRequireGrouping,

"var-require-single-var": settings.VarRequireSingleVar,
"var-require-grouping": settings.VarRequireGrouping,
"type-require-single-type": settings.TypeRequireSingleType,
"type-require-grouping": settings.TypeRequireGrouping,
"var-require-single-var": settings.VarRequireSingleVar,
"var-require-grouping": settings.VarRequireGrouping,
}
}

Expand Down

0 comments on commit 6b0798c

Please sign in to comment.