Skip to content

fix: error message when trying to migrate a migrated config #5836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants