forked from golangci/golangci-lint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathformatters_settings.go
67 lines (57 loc) · 1.86 KB
/
formatters_settings.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package config
var defaultFormatterSettings = FormatterSettings{
GoFmt: GoFmtSettings{
Simplify: true,
},
Gci: GciSettings{
Sections: []string{"standard", "default"},
SkipGenerated: true,
},
GoLines: GoLinesSettings{
MaxLen: 100,
TabLen: 4,
ReformatTags: true,
ChainSplitDots: true,
},
}
type FormatterSettings struct {
Gci GciSettings `mapstructure:"gci"`
GoFmt GoFmtSettings `mapstructure:"gofmt"`
GoFumpt GoFumptSettings `mapstructure:"gofumpt"`
GoImports GoImportsSettings `mapstructure:"goimports"`
GoLines GoLinesSettings `mapstructure:"golines"`
}
type GciSettings struct {
Sections []string `mapstructure:"sections"`
NoInlineComments bool `mapstructure:"no-inline-comments"`
NoPrefixComments bool `mapstructure:"no-prefix-comments"`
SkipGenerated bool `mapstructure:"skip-generated"`
CustomOrder bool `mapstructure:"custom-order"`
NoLexOrder bool `mapstructure:"no-lex-order"`
// Deprecated: use Sections instead.
LocalPrefixes string `mapstructure:"local-prefixes"`
}
type GoFmtSettings struct {
Simplify bool
RewriteRules []GoFmtRewriteRule `mapstructure:"rewrite-rules"`
}
type GoFmtRewriteRule struct {
Pattern string
Replacement string
}
type GoFumptSettings struct {
ModulePath string `mapstructure:"module-path"`
ExtraRules bool `mapstructure:"extra-rules"`
// Deprecated: use the global `run.go` instead.
LangVersion string `mapstructure:"lang-version"`
}
type GoImportsSettings struct {
LocalPrefixes string `mapstructure:"local-prefixes"`
}
type GoLinesSettings struct {
MaxLen int `mapstructure:"max-len"`
TabLen int `mapstructure:"tab-len"`
ShortenComments bool `mapstructure:"shorten-comments"`
ReformatTags bool `mapstructure:"reformat-tags"`
ChainSplitDots bool `mapstructure:"chain-split-dots"`
}