Skip to content

Conversation

@ccoVeille
Copy link
Contributor

The check was done in the wrong place, so it was not triggered
when the config was already migrated.

Another error message was reported about jsonschema validation issues.
Because a v2 config file does not validate against the v1 schema.

That was misleading.

Before
$ golangci-lint migrate 
jsonschema: "linters.exclusions" does not validate with "/properties/linters/properties/exclusions/additionalProperties": additional properties 'presets' not allowed
jsonschema: "linters" does not validate with "/properties/linters/additionalProperties": additional properties 'default', 'settings' not allowed
jsonschema: "" does not validate with "/additionalProperties": additional properties 'version', 'formatters' not allowed
Failed executing command with error: the configuration contains invalid elements
After
$ golangci-lint migrate
The command is terminated due to an error: configuration version is already set: 2
exit status 3

The check was done in the wrong place, so it was not triggered
when the config was already migrated.

Another error message was reported about jsonschema validation issues.
Because a v2 config file does not validate against the v1 schema.

That was misleading.
@CLAassistant
Copy link

CLAassistant commented May 27, 2025

CLA assistant check
All committers have signed the CLA.

@ldez ldez added area: CLI Related to CLI area: migration and removed area: CLI Related to CLI labels May 27, 2025
@ldez ldez changed the title fix: error message when trying to migrate a migrated config. fix: error message when trying to migrate a migrated config May 27, 2025
@ldez ldez self-requested a review May 27, 2025 09:34
@ldez ldez added the area: CLI Related to CLI label May 27, 2025
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit 156db1d into golangci:main May 27, 2025
18 checks passed
@ldez ldez added this to the v2-unreleased milestone May 27, 2025
@ccoVeille ccoVeille deleted the cmd-migrate branch May 27, 2025 10:06
@ldez ldez modified the milestones: v2-unreleased, v2.2 Jun 28, 2025
alaudaa-renovate bot added a commit to AlaudaDevops/golangci-lint that referenced this pull request Aug 5, 2025