{"record":{"id":"2539f50cc23d2996","repo":"golangci/golangci-lint","slug":"disable-all-and-disabled-checks-options-must-not-b","errorCode":null,"errorMessage":"disable-all and disabled-checks options must not be combined","messagePattern":"disable-all and disabled-checks options must not be combined","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/golinters/gocritic/gocritic_settings.go","lineNumber":319,"sourceCode":"\t}\n\n\tswitch {\n\tcase s.EnableAll:\n\t\tif len(s.EnabledTags) > 0 {\n\t\t\treturn errors.New(\"enable-all and enabled-tags options must not be combined\")\n\t\t}\n\n\t\tif len(s.EnabledChecks) > 0 {\n\t\t\treturn errors.New(\"enable-all and enabled-checks options must not be combined\")\n\t\t}\n\n\tcase s.DisableAll:\n\t\tif len(s.DisabledTags) > 0 {\n\t\t\treturn errors.New(\"disable-all and disabled-tags options must not be combined\")\n\t\t}\n\n\t\tif len(s.DisabledChecks) > 0 {\n\t\t\treturn errors.New(\"disable-all and disabled-checks options must not be combined\")\n\t\t}\n\n\t\tif len(s.EnabledTags) == 0 && len(s.EnabledChecks) == 0 {\n\t\t\treturn errors.New(\"all checks were disabled, but no one check was enabled: at least one must be enabled\")\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *settingsWrapper) validateCheckerTags() error {\n\tfor _, tag := range s.EnabledTags {\n\t\tif !s.allChecksByTag.has(tag) {\n\t\t\treturn fmt.Errorf(\"enabled tag %q doesn't exist, see %s's documentation\", tag, linterName)\n\t\t}\n\t}\n\n\tfor _, tag := range s.DisabledTags {","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/golinters/gocritic/gocritic_settings.go#L301-L337","documentation":"Fires inside validateOptionsCombinations when gocritic's DisableAll flag is true and the config also supplies non-empty disabled-checks. The two options conflict: with disable-all everything is already off, so listing checks as disabled is redundant/ambiguous and the settings are rejected before analysis.","triggerScenarios":"Thrown at pkg/golinters/gocritic/gocritic_settings.go:319 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove disabled-checks from gocritic settings when disable-all is true","Use enabled-checks/enabled-tags instead to opt checks back in under disable-all","Set disable-all to false if you genuinely want to disable a subset of checks"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}