From 2e83e329af62f96048b80ddfbc68cdb3f263aafd Mon Sep 17 00:00:00 2001 From: GolangCI-Lint Releaser <65486276+golangci-releaser@users.noreply.github.com> Date: Wed, 12 Mar 2025 01:07:48 +0100 Subject: [PATCH 1/3] docs: update GitHub Action assets (#5528) --- assets/github-action-config-v1.json | 4 ++-- assets/github-action-config.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/github-action-config-v1.json b/assets/github-action-config-v1.json index 3b6bf9821567..e5d182ffc817 100644 --- a/assets/github-action-config-v1.json +++ b/assets/github-action-config-v1.json @@ -1,7 +1,7 @@ { "MinorVersionToConfig": { "latest": { - "TargetVersion": "v1.64.6" + "TargetVersion": "v1.64.7" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.28.3 and later versions" @@ -178,7 +178,7 @@ "TargetVersion": "v1.63.4" }, "v1.64": { - "TargetVersion": "v1.64.6" + "TargetVersion": "v1.64.7" }, "v1.7": { "Error": "golangci-lint version 'v1.7' isn't supported: we support only v1.28.3 and later versions" diff --git a/assets/github-action-config.json b/assets/github-action-config.json index 3b6bf9821567..e5d182ffc817 100644 --- a/assets/github-action-config.json +++ b/assets/github-action-config.json @@ -1,7 +1,7 @@ { "MinorVersionToConfig": { "latest": { - "TargetVersion": "v1.64.6" + "TargetVersion": "v1.64.7" }, "v1.10": { "Error": "golangci-lint version 'v1.10' isn't supported: we support only v1.28.3 and later versions" @@ -178,7 +178,7 @@ "TargetVersion": "v1.63.4" }, "v1.64": { - "TargetVersion": "v1.64.6" + "TargetVersion": "v1.64.7" }, "v1.7": { "Error": "golangci-lint version 'v1.7' isn't supported: we support only v1.28.3 and later versions" From 7bcf51e684a1fae1ff72b6f74f6451bc11d67ce7 Mon Sep 17 00:00:00 2001 From: GolangCI-Lint Releaser <65486276+golangci-releaser@users.noreply.github.com> Date: Wed, 12 Mar 2025 01:11:37 +0100 Subject: [PATCH 2/3] docs: update documentation assets (#5527) Co-authored-by: Fernandez Ludovic --- CHANGELOG.md | 10 ++++++++++ assets/linters-info.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f90f45126fa..6af68c66e714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ If you value it, consider supporting us, we appreciate it! ❤️ [![Open Collective backers and sponsors](https://img.shields.io/badge/OpenCollective-Donate-blue?logo=opencollective&style=for-the-badge)](https://opencollective.com/golangci-lint) [![GitHub Sponsors](https://img.shields.io/badge/GitHub-Donate-blue?logo=github&style=for-the-badge)](https://github.com/sponsors/golangci) +### v1.64.7 + +1. Linters bug fixes + * `depguard`: from 2.2.0 to 2.2.1 + * `dupl`: from 3e9179ac440a to f665c8d69b32 + * `gosec`: from 2.22.1 to 2.22.2 + * `staticcheck`: from 0.6.0 to 0.6.1 +2. Documentation + * Add GitLab documentation + ### v1.64.6 1. Linters bug fixes diff --git a/assets/linters-info.json b/assets/linters-info.json index 15b47050d2ed..5331c5531ca4 100644 --- a/assets/linters-info.json +++ b/assets/linters-info.json @@ -151,7 +151,7 @@ }, { "name": "dupl", - "desc": "Tool for code clone detection", + "desc": "Detects duplicate fragments of code.", "loadMode": 8199, "inPresets": [ "style" From 8b37f14162043f908949f1b363d061dc9ba713c0 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 17 Mar 2025 17:54:02 +0100 Subject: [PATCH 3/3] fix: check version of the configuration (#5564) --- pkg/commands/run.go | 4 ++++ pkg/config/config.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/pkg/commands/run.go b/pkg/commands/run.go index 3aa467daef3f..57f3cdd9936f 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -186,6 +186,10 @@ func (c *runCommand) persistentPostRunE(_ *cobra.Command, _ []string) error { } func (c *runCommand) preRunE(_ *cobra.Command, args []string) error { + if c.cfg.GetConfigDir() != "" && c.cfg.Version != "" { + return errors.New("you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2") + } + dbManager, err := lintersdb.NewManager(c.log.Child(logutils.DebugKeyLintersDB), c.cfg, lintersdb.NewLinterBuilder(), lintersdb.NewPluginModuleBuilder(c.log), lintersdb.NewPluginGoBuilder(c.log)) if err != nil { diff --git a/pkg/config/config.go b/pkg/config/config.go index 4ddd896170d9..ee7a62b7e229 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -20,6 +20,8 @@ type Config struct { cfgDir string // Path to the directory containing golangci-lint config file. basePath string // Path the root directory related to [Run.RelativePathMode]. + Version string `mapstructure:"version"` // From v2, to be able to detect v2 config file. + Run Run `mapstructure:"run"` Output Output `mapstructure:"output"`