Skip to content

dev: sorting linters by alphabet (ascending order) #2437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 62 additions & 62 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,70 @@ package config
import "github.com/pkg/errors"

var defaultLintersSettings = LintersSettings{
Dogsled: DogsledSettings{
MaxBlankIdentifiers: 2,
},
ErrorLint: ErrorLintSettings{
Errorf: true,
Asserts: true,
Comparison: true,
},
Exhaustive: ExhaustiveSettings{
CheckGenerated: false,
DefaultSignifiesExhaustive: false,
IgnoreEnumMembers: "",
CheckingStrategy: "value",
},
Forbidigo: ForbidigoSettings{
ExcludeGodocExamples: true,
},
Gocognit: GocognitSettings{
MinComplexity: 30,
},
Gocritic: GocriticSettings{
SettingsPerCheck: map[string]GocriticCheckSettings{},
},
Godox: GodoxSettings{
Keywords: []string{},
},
Gofumpt: GofumptSettings{
LangVersion: "",
ExtraRules: false,
},
Ifshort: IfshortSettings{
MaxDeclLines: 1,
MaxDeclChars: 30,
},
Lll: LllSettings{
LineLength: 120,
TabWidth: 1,
},
Unparam: UnparamSettings{
Algo: "cha",
},
Nakedret: NakedretSettings{
MaxFuncLines: 30,
},
Nestif: NestifSettings{
MinComplexity: 5,
},
NoLintLint: NoLintLintSettings{
RequireExplanation: false,
AllowLeadingSpace: true,
RequireSpecific: false,
AllowUnused: false,
},
Prealloc: PreallocSettings{
Simple: true,
RangeLoops: true,
ForLoops: false,
},
Gocritic: GocriticSettings{
SettingsPerCheck: map[string]GocriticCheckSettings{},
},
Godox: GodoxSettings{
Keywords: []string{},
Predeclared: PredeclaredSettings{
Ignore: "",
Qualified: false,
},
Dogsled: DogsledSettings{
MaxBlankIdentifiers: 2,
Testpackage: TestpackageSettings{
SkipRegexp: `(export|internal)_test\.go`,
},
Gocognit: GocognitSettings{
MinComplexity: 30,
Unparam: UnparamSettings{
Algo: "cha",
},
WSL: WSLSettings{
StrictAppend: true,
Expand All @@ -42,44 +80,6 @@ var defaultLintersSettings = LintersSettings{
ForceExclusiveShortDeclarations: false,
ForceCaseTrailingWhitespaceLimit: 0,
},
NoLintLint: NoLintLintSettings{
RequireExplanation: false,
AllowLeadingSpace: true,
RequireSpecific: false,
AllowUnused: false,
},
Testpackage: TestpackageSettings{
SkipRegexp: `(export|internal)_test\.go`,
},
Nestif: NestifSettings{
MinComplexity: 5,
},
Exhaustive: ExhaustiveSettings{
CheckGenerated: false,
DefaultSignifiesExhaustive: false,
IgnoreEnumMembers: "",
CheckingStrategy: "value",
},
Gofumpt: GofumptSettings{
LangVersion: "",
ExtraRules: false,
},
ErrorLint: ErrorLintSettings{
Errorf: true,
Asserts: true,
Comparison: true,
},
Ifshort: IfshortSettings{
MaxDeclLines: 1,
MaxDeclChars: 30,
},
Predeclared: PredeclaredSettings{
Ignore: "",
Qualified: false,
},
Forbidigo: ForbidigoSettings{
ExcludeGodocExamples: true,
},
}

type LintersSettings struct {
Expand Down Expand Up @@ -114,8 +114,8 @@ type LintersSettings struct {
Gosimple StaticCheckSettings
Govet GovetSettings
Ifshort IfshortSettings
Ireturn IreturnSettings
ImportAs ImportAsSettings
Ireturn IreturnSettings
Lll LllSettings
Makezero MakezeroSettings
Maligned MalignedSettings
Expand All @@ -134,9 +134,9 @@ type LintersSettings struct {
Structcheck StructCheckSettings
Stylecheck StaticCheckSettings
Tagliatelle TagliatelleSettings
Tenv TenvSettings
Testpackage TestpackageSettings
Thelper ThelperSettings
Tenv TenvSettings
Unparam UnparamSettings
Unused StaticCheckSettings
Varcheck VarCheckSettings
Expand Down Expand Up @@ -166,11 +166,6 @@ type Cyclop struct {
SkipTests bool `mapstructure:"skip-tests"`
}

type ErrChkJSONSettings struct {
CheckErrorFreeEncoding bool `mapstructure:"check-error-free-encoding"`
ReportNoExported bool `mapstructure:"report-no-exported"`
}

type DepGuardSettings struct {
ListType string `mapstructure:"list-type"`
Packages []string
Expand All @@ -196,6 +191,11 @@ type ErrcheckSettings struct {
Exclude string `mapstructure:"exclude"`
}

type ErrChkJSONSettings struct {
CheckErrorFreeEncoding bool `mapstructure:"check-error-free-encoding"`
ReportNoExported bool `mapstructure:"report-no-exported"`
}

type ErrorLintSettings struct {
Errorf bool `mapstructure:"errorf"`
Asserts bool `mapstructure:"asserts"`
Expand All @@ -216,11 +216,6 @@ type ExhaustiveStructSettings struct {
StructPatterns []string `mapstructure:"struct-patterns"`
}

type IreturnSettings struct {
Allow []string `mapstructure:"allow"`
Reject []string `mapstructure:"reject"`
}

type ForbidigoSettings struct {
Forbid []string `mapstructure:"forbid"`
ExcludeGodocExamples bool `mapstructure:"exclude-godoc-examples"`
Expand Down Expand Up @@ -366,6 +361,11 @@ type ImportAsAlias struct {
Alias string
}

type IreturnSettings struct {
Allow []string `mapstructure:"allow"`
Reject []string `mapstructure:"reject"`
}

type LllSettings struct {
LineLength int `mapstructure:"line-length"`
TabWidth int `mapstructure:"tab-width"`
Expand Down
Loading