golangci-lint/pkg/config/config.go

51 lines
843 B
Go
Raw Normal View History

package config
2018-05-05 09:24:37 +03:00
type OutFormat string
const (
OutFormatJSON = "json"
OutFormatLineNumber = "line-number"
OutFormatColoredLineNumber = "colored-line-number"
)
var OutFormats = []string{OutFormatColoredLineNumber, OutFormatLineNumber, OutFormatJSON}
type Common struct {
2018-05-05 19:43:18 +03:00
IsVerbose bool
CPUProfilePath string
2018-05-05 09:24:37 +03:00
}
type Run struct {
2018-05-05 19:43:18 +03:00
Paths []string
BuildTags []string
2018-05-05 11:08:14 +03:00
OutFormat string
ExitCodeIfIssuesFound int
2018-05-05 19:43:18 +03:00
Errcheck struct {
CheckClose bool
CheckTypeAssertions bool
CheckAssignToBlank bool
}
2018-05-05 22:22:21 +03:00
Govet struct {
CheckShadowing bool
}
2018-05-06 07:20:12 +03:00
Golint struct {
MinConfidence float64
}
2018-05-05 09:24:37 +03:00
}
type Config struct {
2018-05-05 09:24:37 +03:00
Common Common
Run Run
}
func NewDefault() *Config {
return &Config{
Run: Run{
Paths: []string{"./..."},
OutFormat: OutFormatColoredLineNumber,
},
}
}