Skip to content

Commit 5d9896a

Browse files
butuzovldez
andauthored
dev: sorting linters by alphabet (ascending order) (#2437)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent ec2820c commit 5d9896a

File tree

2 files changed

+426
-345
lines changed

2 files changed

+426
-345
lines changed

pkg/config/linters_settings.go

+62-62
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,70 @@ package config
33
import "github.com/pkg/errors"
44

55
var defaultLintersSettings = LintersSettings{
6+
Dogsled: DogsledSettings{
7+
MaxBlankIdentifiers: 2,
8+
},
9+
ErrorLint: ErrorLintSettings{
10+
Errorf: true,
11+
Asserts: true,
12+
Comparison: true,
13+
},
14+
Exhaustive: ExhaustiveSettings{
15+
CheckGenerated: false,
16+
DefaultSignifiesExhaustive: false,
17+
IgnoreEnumMembers: "",
18+
CheckingStrategy: "value",
19+
},
20+
Forbidigo: ForbidigoSettings{
21+
ExcludeGodocExamples: true,
22+
},
23+
Gocognit: GocognitSettings{
24+
MinComplexity: 30,
25+
},
26+
Gocritic: GocriticSettings{
27+
SettingsPerCheck: map[string]GocriticCheckSettings{},
28+
},
29+
Godox: GodoxSettings{
30+
Keywords: []string{},
31+
},
32+
Gofumpt: GofumptSettings{
33+
LangVersion: "",
34+
ExtraRules: false,
35+
},
36+
Ifshort: IfshortSettings{
37+
MaxDeclLines: 1,
38+
MaxDeclChars: 30,
39+
},
640
Lll: LllSettings{
741
LineLength: 120,
842
TabWidth: 1,
943
},
10-
Unparam: UnparamSettings{
11-
Algo: "cha",
12-
},
1344
Nakedret: NakedretSettings{
1445
MaxFuncLines: 30,
1546
},
47+
Nestif: NestifSettings{
48+
MinComplexity: 5,
49+
},
50+
NoLintLint: NoLintLintSettings{
51+
RequireExplanation: false,
52+
AllowLeadingSpace: true,
53+
RequireSpecific: false,
54+
AllowUnused: false,
55+
},
1656
Prealloc: PreallocSettings{
1757
Simple: true,
1858
RangeLoops: true,
1959
ForLoops: false,
2060
},
21-
Gocritic: GocriticSettings{
22-
SettingsPerCheck: map[string]GocriticCheckSettings{},
23-
},
24-
Godox: GodoxSettings{
25-
Keywords: []string{},
61+
Predeclared: PredeclaredSettings{
62+
Ignore: "",
63+
Qualified: false,
2664
},
27-
Dogsled: DogsledSettings{
28-
MaxBlankIdentifiers: 2,
65+
Testpackage: TestpackageSettings{
66+
SkipRegexp: `(export|internal)_test\.go`,
2967
},
30-
Gocognit: GocognitSettings{
31-
MinComplexity: 30,
68+
Unparam: UnparamSettings{
69+
Algo: "cha",
3270
},
3371
WSL: WSLSettings{
3472
StrictAppend: true,
@@ -42,44 +80,6 @@ var defaultLintersSettings = LintersSettings{
4280
ForceExclusiveShortDeclarations: false,
4381
ForceCaseTrailingWhitespaceLimit: 0,
4482
},
45-
NoLintLint: NoLintLintSettings{
46-
RequireExplanation: false,
47-
AllowLeadingSpace: true,
48-
RequireSpecific: false,
49-
AllowUnused: false,
50-
},
51-
Testpackage: TestpackageSettings{
52-
SkipRegexp: `(export|internal)_test\.go`,
53-
},
54-
Nestif: NestifSettings{
55-
MinComplexity: 5,
56-
},
57-
Exhaustive: ExhaustiveSettings{
58-
CheckGenerated: false,
59-
DefaultSignifiesExhaustive: false,
60-
IgnoreEnumMembers: "",
61-
CheckingStrategy: "value",
62-
},
63-
Gofumpt: GofumptSettings{
64-
LangVersion: "",
65-
ExtraRules: false,
66-
},
67-
ErrorLint: ErrorLintSettings{
68-
Errorf: true,
69-
Asserts: true,
70-
Comparison: true,
71-
},
72-
Ifshort: IfshortSettings{
73-
MaxDeclLines: 1,
74-
MaxDeclChars: 30,
75-
},
76-
Predeclared: PredeclaredSettings{
77-
Ignore: "",
78-
Qualified: false,
79-
},
80-
Forbidigo: ForbidigoSettings{
81-
ExcludeGodocExamples: true,
82-
},
8383
}
8484

8585
type LintersSettings struct {
@@ -114,8 +114,8 @@ type LintersSettings struct {
114114
Gosimple StaticCheckSettings
115115
Govet GovetSettings
116116
Ifshort IfshortSettings
117-
Ireturn IreturnSettings
118117
ImportAs ImportAsSettings
118+
Ireturn IreturnSettings
119119
Lll LllSettings
120120
Makezero MakezeroSettings
121121
Maligned MalignedSettings
@@ -134,9 +134,9 @@ type LintersSettings struct {
134134
Structcheck StructCheckSettings
135135
Stylecheck StaticCheckSettings
136136
Tagliatelle TagliatelleSettings
137+
Tenv TenvSettings
137138
Testpackage TestpackageSettings
138139
Thelper ThelperSettings
139-
Tenv TenvSettings
140140
Unparam UnparamSettings
141141
Unused StaticCheckSettings
142142
Varcheck VarCheckSettings
@@ -166,11 +166,6 @@ type Cyclop struct {
166166
SkipTests bool `mapstructure:"skip-tests"`
167167
}
168168

169-
type ErrChkJSONSettings struct {
170-
CheckErrorFreeEncoding bool `mapstructure:"check-error-free-encoding"`
171-
ReportNoExported bool `mapstructure:"report-no-exported"`
172-
}
173-
174169
type DepGuardSettings struct {
175170
ListType string `mapstructure:"list-type"`
176171
Packages []string
@@ -196,6 +191,11 @@ type ErrcheckSettings struct {
196191
Exclude string `mapstructure:"exclude"`
197192
}
198193

194+
type ErrChkJSONSettings struct {
195+
CheckErrorFreeEncoding bool `mapstructure:"check-error-free-encoding"`
196+
ReportNoExported bool `mapstructure:"report-no-exported"`
197+
}
198+
199199
type ErrorLintSettings struct {
200200
Errorf bool `mapstructure:"errorf"`
201201
Asserts bool `mapstructure:"asserts"`
@@ -216,11 +216,6 @@ type ExhaustiveStructSettings struct {
216216
StructPatterns []string `mapstructure:"struct-patterns"`
217217
}
218218

219-
type IreturnSettings struct {
220-
Allow []string `mapstructure:"allow"`
221-
Reject []string `mapstructure:"reject"`
222-
}
223-
224219
type ForbidigoSettings struct {
225220
Forbid []string `mapstructure:"forbid"`
226221
ExcludeGodocExamples bool `mapstructure:"exclude-godoc-examples"`
@@ -366,6 +361,11 @@ type ImportAsAlias struct {
366361
Alias string
367362
}
368363

364+
type IreturnSettings struct {
365+
Allow []string `mapstructure:"allow"`
366+
Reject []string `mapstructure:"reject"`
367+
}
368+
369369
type LllSettings struct {
370370
LineLength int `mapstructure:"line-length"`
371371
TabWidth int `mapstructure:"tab-width"`

0 commit comments

Comments
 (0)