golangci-lint/pkg/config/config.go

68 lines
1.2 KiB
Go
Raw Normal View History

package config
2018-05-06 09:41:48 +03:00
import "github.com/golangci/golangci-lint/pkg/fsutils"
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}
2018-05-06 13:41:42 +03:00
var DefaultExcludePatterns = []string{"should have comment", "comment on exported method"}
2018-05-05 09:24:37 +03:00
type Common struct {
2018-05-05 19:43:18 +03:00
IsVerbose bool
CPUProfilePath string
2018-05-06 12:08:57 +03:00
Concurrency int
2018-05-05 09:24:37 +03:00
}
type Run struct {
2018-05-06 09:41:48 +03:00
Paths *fsutils.ProjectPaths
2018-05-05 19:43:18 +03:00
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-06 09:41:48 +03:00
Gofmt struct {
Simplify bool
}
2018-05-06 15:24:45 +03:00
Gocyclo struct {
MinComplexity int
}
EnabledLinters []string
DisabledLinters []string
EnableAllLinters bool
DisableAllLinters bool
2018-05-06 13:41:42 +03:00
ExcludePatterns []string
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{
OutFormat: OutFormatColoredLineNumber,
},
}
}