golangci/golangci-lint · error

disable-all and disabled-checks options must not be combined

Error message

disable-all and disabled-checks options must not be combined

What it means

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.

Source

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

	}

	switch {
	case s.EnableAll:
		if len(s.EnabledTags) > 0 {
			return errors.New("enable-all and enabled-tags options must not be combined")
		}

		if len(s.EnabledChecks) > 0 {
			return errors.New("enable-all and enabled-checks options must not be combined")
		}

	case s.DisableAll:
		if len(s.DisabledTags) > 0 {
			return errors.New("disable-all and disabled-tags options must not be combined")
		}

		if len(s.DisabledChecks) > 0 {
			return errors.New("disable-all and disabled-checks options must not be combined")
		}

		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 {

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Remove disabled-checks from gocritic settings when disable-all is true
  2. Use enabled-checks/enabled-tags instead to opt checks back in under disable-all
  3. Set disable-all to false if you genuinely want to disable a subset of checks
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/golinters/gocritic/gocritic_settings.go:319 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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