Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/commands/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
Loading