{"record":{"id":"5e84fdb2153433a2","repo":"golangci/golangci-lint","slug":"invalid-check-settings-check-q-doesn-t-exist-se","errorCode":null,"errorMessage":"invalid check settings: check %q doesn't exist, see %s documentation","messagePattern":"invalid check settings: check %q doesn't exist, see (.+?) documentation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/golinters/gocritic/gocritic_settings.go","lineNumber":363,"sourceCode":"\nfunc (s *settingsWrapper) validateCheckerNames() error {\n\tfor _, check := range s.EnabledChecks {\n\t\tif !s.allChecks.has(check) {\n\t\t\treturn fmt.Errorf(\"enabled check %q doesn't exist, see %s's documentation\", check, linterName)\n\t\t}\n\t}\n\n\tfor _, check := range s.DisabledChecks {\n\t\tif !s.allChecks.has(check) {\n\t\t\treturn fmt.Errorf(\"disabled check %q doesn't exist, see %s documentation\", check, linterName)\n\t\t}\n\t}\n\n\tfor check := range s.SettingsPerCheck {\n\t\tlcName := strings.ToLower(check)\n\n\t\tif !s.allChecksLowerCased.has(lcName) {\n\t\t\treturn fmt.Errorf(\"invalid check settings: check %q doesn't exist, see %s documentation\", check, linterName)\n\t\t}\n\n\t\tif !s.inferredEnabledChecksLowerCased.has(lcName) {\n\t\t\ts.logger.Warnf(\"%s: settings were provided for disabled check %q\", check, linterName)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (s *settingsWrapper) validateDisabledAndEnabledAtOneMoment() error {\n\tfor _, tag := range s.DisabledTags {\n\t\tif slices.Contains(s.EnabledTags, tag) {\n\t\t\treturn fmt.Errorf(\"tag %q disabled and enabled at one moment\", tag)\n\t\t}\n\t}\n\n\tfor _, check := range s.DisabledChecks {","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/golinters/gocritic/gocritic_settings.go#L345-L381","documentation":"gocritic per-check settings (settings.gocritic.settings.<check>) must reference an existing gocritic check, compared case-insensitively. A settings key that doesn't match any check (lowercased) aborts the run with this error.","triggerScenarios":"validateCheckerNames iterates s.SettingsPerCheck, lowercases each key, and fails when allChecksLowerCased doesn't contain it — e.g. key 'RangeValCopy ' with typo or a check name from another linter.","commonSituations":"Typos in per-check setting keys, providing settings for a check removed in a gocritical upgrade, pasting settings blocks from example configs for checks that don't exist.","solutions":["Fix the check-name key under settings.gocritic.settings to match a real gocritic check (case-insensitive)","Remove the settings block for the nonexistent check","Confirm the check exists in your pinned gocritic version","Optionally add the (valid) check to enabled-checks; note a separate warning fires if settings target a disabled check"],"exampleFix":"// before (.golangci.yml)\nsettings:\n  gocritic:\n    settings:\n      rangValCopy:\n        rangeSizeThreshold: 128\n// after\nsettings:\n  gocritic:\n    settings:\n      rangeValCopy:\n        rangeSizeThreshold: 128","handlingStrategy":"validation","validationCode":"const knownLower = new Set(getGocriticChecksForVersion().map(c => c.toLowerCase()))\nconst bad = Object.keys(cfg.settings.gocritic.settings ?? {}).filter(k => !knownLower.has(k.toLowerCase()))\nif (bad.length) throw new Error(`settings for unknown gocritic checks: ${bad.join(', ')}`)","typeGuard":"const hasValidCheckSettings = (s) => Object.keys(s ?? {}).every(k => knownLower.has(k.toLowerCase()))","tryCatchPattern":null,"preventionTips":["Match per-check settings keys to real check names (comparison is case-insensitive but spelling must be right)","Don't keep settings blocks for checks you've removed","Verify merged config keys after refactors"],"tags":["golangci-lint","gocritic","configuration"],"backgroundTag":"invalid-linter-config-option","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}