golangci/golangci-lint · error

invalid configuration: 'version' and 'path' should not be pr

Error message

invalid configuration: 'version' and 'path' should not be provided at the same time

What it means

`Configuration.Validate` (pkg/commands/internal/configuration.go:60) enforces mutual exclusivity: a plugin may specify a `version` (remote module via Go proxy) OR a `path` (local module), never both, since the two sources conflict. Supplying both on the same plugin entry returns this error.

Source

Thrown at pkg/commands/internal/configuration.go:60

	if len(c.Plugins) == 0 {
		return errors.New("no plugins defined")
	}

	for _, plugin := range c.Plugins {
		if strings.TrimSpace(plugin.Module) == "" {
			return errors.New("field 'module' is required")
		}

		if strings.TrimSpace(plugin.Import) == "" {
			plugin.Import = plugin.Module
		}

		if strings.TrimSpace(plugin.Path) == "" && strings.TrimSpace(plugin.Version) == "" {
			return errors.New("missing information: 'version' or 'path' should be provided")
		}

		if strings.TrimSpace(plugin.Path) != "" && strings.TrimSpace(plugin.Version) != "" {
			return errors.New("invalid configuration: 'version' and 'path' should not be provided at the same time")
		}

		if strings.TrimSpace(plugin.Path) == "" {
			continue
		}

		abs, err := filepath.Abs(plugin.Path)
		if err != nil {
			return err
		}

		plugin.Path = abs
	}

	return nil
}

// Plugin represents information about a plugin.

View on GitHub (pinned to ed7a235d2d)

Solutions

  1. Remove the `version` field from the plugin entry if you intend to build from the local `path`
  2. Or remove the `path` field and keep `version` to use the Go-proxy-published module
  3. Remember this is per-plugin: other entries may use whichever source they need

Example fix

# before
plugins:
  - module: github.com/me/my-plugin
    version: v1.0.0
    path: ../my-plugin
# after
plugins:
  - module: github.com/me/my-plugin
    path: ../my-plugin
Defensive patterns

Strategy: validation

Validate before calling

for i, p := range plugins {
	if p.Path != "" && p.Version != "" {
		log.Fatalf("plugins[%d]: version and path are mutually exclusive", i)
	}
}

Prevention

When it happens

Trigger: A plugins entry in `.custom-gcl.yml` where a single item has non-empty values for both `version:` and `path:` — e.g. migrated from remote to local development by adding `path` while leaving `version` in place.

Common situations: Temporarily pointing a published plugin at a local checkout for debugging but keeping the old `version` line; copy-pasting two example plugin entries into one; misunderstanding the fields as complementary rather than exclusive.

Related errors


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