2021-11-14 20:01:54 +00:00
|
|
|
package config
|
|
|
|
|
2021-11-16 20:07:53 +00:00
|
|
|
// Config encapsulates the config data specified in the golangci yaml config file.
|
2021-11-14 20:01:54 +00:00
|
|
|
type Config struct {
|
2021-11-16 20:07:53 +00:00
|
|
|
cfgDir string // The directory containing the golangci config file.
|
|
|
|
Run Run
|
2021-11-14 20:01:54 +00:00
|
|
|
|
|
|
|
Output Output
|
|
|
|
|
|
|
|
LintersSettings LintersSettings `mapstructure:"linters-settings"`
|
|
|
|
Linters Linters
|
|
|
|
Issues Issues
|
|
|
|
Severity Severity
|
|
|
|
Version Version
|
|
|
|
|
|
|
|
InternalCmdTest bool `mapstructure:"internal-cmd-test"` // Option is used only for testing golangci-lint command, don't use it
|
|
|
|
InternalTest bool // Option is used only for testing golangci-lint code, don't use it
|
|
|
|
}
|
|
|
|
|
2022-02-24 16:33:24 +00:00
|
|
|
// GetConfigDir returns the directory that contains golangci config file.
|
2021-11-16 20:07:53 +00:00
|
|
|
func (c *Config) GetConfigDir() string {
|
|
|
|
return c.cfgDir
|
|
|
|
}
|
|
|
|
|
2021-11-14 20:01:54 +00:00
|
|
|
func NewDefault() *Config {
|
|
|
|
return &Config{
|
|
|
|
LintersSettings: defaultLintersSettings,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type Version struct {
|
|
|
|
Format string `mapstructure:"format"`
|
|
|
|
}
|