@@ -139,6 +139,19 @@ func getEnabledByDefaultFastLintersExcept(except ...string) []string {
139
139
return ret
140
140
}
141
141
142
+ func getAllFastLintersWith (with ... string ) []string {
143
+ linters := lintersdb .GetAllSupportedLinterConfigs ()
144
+ ret := append ([]string {}, with ... )
145
+ for _ , linter := range linters {
146
+ if linter .DoesFullImport {
147
+ continue
148
+ }
149
+ ret = append (ret , linter .Linter .Name ())
150
+ }
151
+
152
+ return ret
153
+ }
154
+
142
155
func getEnabledByDefaultLinters () []string {
143
156
ebdl := lintersdb .GetAllEnabledByDefaultLinters ()
144
157
ret := []string {}
@@ -180,6 +193,15 @@ func mergeMegacheck(linters []string) []string {
180
193
return linters
181
194
}
182
195
196
+ func TestEnableAllFastAndEnableCanCoexist (t * testing.T ) {
197
+ out , exitCode := runGolangciLint (t , "--fast" , "--enable-all" , "--enable=typecheck" )
198
+ checkNoIssuesRun (t , out , exitCode )
199
+
200
+ _ , exitCode = runGolangciLint (t , "--enable-all" , "--enable=typecheck" )
201
+ assert .Equal (t , 3 , exitCode )
202
+
203
+ }
204
+
183
205
func TestEnabledLinters (t * testing.T ) {
184
206
type tc struct {
185
207
name string
@@ -267,6 +289,12 @@ func TestEnabledLinters(t *testing.T) {
267
289
el : getEnabledByDefaultLinters (),
268
290
noImplicitFast : true ,
269
291
},
292
+ {
293
+ name : "fast option combined with enable and enable-all" ,
294
+ args : "--enable-all --fast --enable=typecheck" ,
295
+ el : getAllFastLintersWith ("typecheck" ),
296
+ noImplicitFast : true ,
297
+ },
270
298
}
271
299
272
300
for _ , c := range cases {
0 commit comments