golangci/golangci-lint · error

disabled check %q doesn't exist, see %s documentation

Error message

disabled check %q doesn't exist, see %s documentation

What it means

Like enabled checks, every check in settings.gocritic.disabled-checks must exist in gocritic's registry. An unknown name fails configuration validation with this error (note the message says 'see %s documentation' without the possessive).

Source

Thrown at pkg/golinters/gocritic/gocritic_settings.go:355

	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)
		}
	}

	for check := range s.SettingsPerCheck {
		lcName := strings.ToLower(check)

		if !s.allChecksLowerCased.has(lcName) {
			return fmt.Errorf("invalid check settings: check %q doesn't exist, see %s documentation", check, linterName)
		}

		if !s.inferredEnabledChecksLowerCased.has(lcName) {
			s.logger.Warnf("%s: settings were provided for disabled check %q", check, linterName)
		}
	}

	return nil
}

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Fix the check name spelling in settings.gocritic.disabled-checks
  2. Verify the check exists in your gocritic version's check list
  3. Remove the invalid entry if the check doesn't exist anyway
  4. If intending per-check settings, put it under settings.gocritic.settings instead

Example fix

// before (.golangci.yml)
settings:
  gocritic:
    disabled-checks:
      - ifElseChian
// after
settings:
  gocritic:
    disabled-checks:
      - ifElseChain
Defensive patterns

Strategy: validation

Validate before calling

const knownChecks = new Set(getGocriticChecksForVersion())
const bad = cfg.settings.gocritic['disabled-checks'].filter(c => !knownChecks.has(c))
if (bad.length) throw new Error(`unknown gocritic checks in disabled-checks: ${bad.join(', ')}`)

Type guard

const isKnownGocriticCheck = (c) => knownChecks.has(c)

Prevention

When it happens

Trigger: Config's settings.gocritic.disabled-checks contains a check name absent from allChecks; validateCheckerNames iterates DisabledChecks and returns this error on first miss.

Common situations: Typos when disabling noisy checks, disabling a check that was renamed/removed in a newer gocritic, mixing up per-check settings keys with disabled-checks entries.

Related errors


AI-assisted analysis of golangci/golangci-lint@ed7a235d2d (2026-09-02). Data as JSON: /api/errors/a84566852102d44b. Report an issue: GitHub.