@@ -139,6 +139,19 @@ func getEnabledByDefaultFastLintersExcept(except ...string) []string {
139139 return ret
140140}
141141
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+
142155func getEnabledByDefaultLinters () []string {
143156 ebdl := lintersdb .GetAllEnabledByDefaultLinters ()
144157 ret := []string {}
@@ -180,6 +193,15 @@ func mergeMegacheck(linters []string) []string {
180193 return linters
181194}
182195
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+
183205func TestEnabledLinters (t * testing.T ) {
184206 type tc struct {
185207 name string
@@ -267,6 +289,12 @@ func TestEnabledLinters(t *testing.T) {
267289 el : getEnabledByDefaultLinters (),
268290 noImplicitFast : true ,
269291 },
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+ },
270298 }
271299
272300 for _ , c := range cases {
0 commit comments