Skip to content

dev: improve migration suggestion for gomodguardv2#6472

Open
ldez wants to merge 1 commit intogolangci:mainfrom
ldez:feat/improve-gomodguardv2-migration
Open

dev: improve migration suggestion for gomodguardv2#6472
ldez wants to merge 1 commit intogolangci:mainfrom
ldez:feat/improve-gomodguardv2-migration

Conversation

@ldez
Copy link
Copy Markdown
Member

@ldez ldez commented Mar 30, 2026

When there is no explicit configuration, the current suggestion is:

linters:
  enable:
    - gomodguard_v2
  settings:
    gomodguard_v2:
      allowed: []
      blocked: []
      local-replace-directives: false 

with this PR, the suggestion is:

linters:
  enable:
    - gomodguard_v2

Same thing when the other fields are not explicitly set.

@ldez ldez added this to the unreleased milestone Mar 30, 2026
@ldez ldez added topic: cosmetic changes contain cosmetic improvements linter: update Update the linter implementation inside golangci-lint area: migration labels Mar 30, 2026
Comment on lines +192 to +196
settings := mgr(data)

if settings != nil {
linters["settings"] = map[string]any{d.Replacement: settings}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be replacement? It's only for the d.Replacement settings key and not linter["settings"].

Suggested change
settings := mgr(data)
if settings != nil {
linters["settings"] = map[string]any{d.Replacement: settings}
}
replacement := mgr(data)
if settings != nil {
linters["settings"] = map[string]any{d.Replacement: replacement}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: migration linter: update Update the linter implementation inside golangci-lint topic: cosmetic changes contain cosmetic improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants