golangci/golangci-lint · error
disabled tag %q doesn't exist, see %s's documentation
Error message
disabled tag %q doesn't exist, see %s's documentation
What it means
golangci-lint's gocritic wrapper validates that every tag listed under gocritic.settings.disabled-tags actually exists among gocritic's known check tags. If a tag name doesn't match any known tag, configuration parsing fails with this error before any code is linted.
Source
Thrown at pkg/golinters/gocritic/gocritic_settings.go:339
if len(s.EnabledTags) == 0 && len(s.EnabledChecks) == 0 {
return errors.New("all checks were disabled, but no one check was enabled: at least one must be enabled")
}
}
return nil
}
func (s *settingsWrapper) validateCheckerTags() error {
for _, tag := range s.EnabledTags {
if !s.allChecksByTag.has(tag) {
return fmt.Errorf("enabled tag %q doesn't exist, see %s's documentation", tag, linterName)
}
}
for _, tag := range s.DisabledTags {
if !s.allChecksByTag.has(tag) {
return fmt.Errorf("disabled tag %q doesn't exist, see %s's documentation", tag, linterName)
}
}
return nil
}
func (s *settingsWrapper) validateCheckerNames() error {
for _, check := range s.EnabledChecks {
if !s.allChecks.has(check) {
return fmt.Errorf("enabled check %q doesn't exist, see %s's documentation", check, linterName)
}
}
for _, check := range s.DisabledChecks {
if !s.allChecks.has(check) {
return fmt.Errorf("disabled check %q doesn't exist, see %s documentation", check, linterName)
}
}View on GitHub (pinned to ed7a235d2d)
Solutions
- Fix the tag spelling in .golangci.yml under settings.gocritic.disabled-tags
- Run 'golangci-lint cache clean' is irrelevant; instead check valid tags via 'go vet' tooling or gocritic docs / 'golangci-lint help gocritic' style listing
- Remove the unknown tag from disabled-tags if disabling it is not needed
- Pin golangci-lint/gocritic version and confirm the tag exists in that version
Example fix
// before (.golangci.yml)
settings:
gocritic:
disabled-tags:
- stylig
// after
settings:
gocritic:
disabled-tags:
- style Defensive patterns
Strategy: validation
Validate before calling
const validGocriticTags = new Set(['diagnostic','style','performance','experimental','opinionated','security'])
function assertTagsValid(tags) {
const bad = tags.filter(t => !validGocriticTags.has(t))
if (bad.length) throw new Error(`unknown gocritic tags: ${bad.join(', ')}`)
}
assertTagsValid(cfg.settings.gocritic['disabled-tags'] ?? []) Type guard
const isKnownGocriticTag = (t) => ['diagnostic','style','performance','experimental','opinionated','security'].includes(t)
Prevention
- Verify config with 'golangci-lint config verify' before committing
- Keep disabled-tags limited to documented gocritic tags
- Pin golangci-lint version and re-verify tags after upgrades
When it happens
Trigger: Running golangci-lint with config settings.gocritic.disabled-tags containing a tag that gocritic does not define (typo, renamed tag, or tag from a different linter). validateCheckerTags checks each tag against allChecksByTag.
Common situations: Typos like 'style' vs 'styling', copying tags from golangci-lint's other linters, gocritic adding/renaming tags in a version upgrade so a previously valid tag disappears.
Related errors
- checker %s config param %s doesn't exist: checker doesn't ha
- checker %s config param %s doesn't exist, all existing: %s
- enabled tag %q doesn't exist, see %s's documentation
- enabled check %q doesn't exist, see %s's documentation
- disabled check %q doesn't exist, see %s documentation
AI-assisted analysis of golangci/golangci-lint@ed7a235d2d (2026-09-02).
Data as JSON: /api/errors/00ff514b44b31c1a.
Report an issue: GitHub.