gofumpt: add module-path setting (#2644)
This commit is contained in:
parent
93a0015cfc
commit
42ca644953
@ -511,6 +511,10 @@ linters-settings:
|
||||
# Default: 1.15
|
||||
lang-version: "1.17"
|
||||
|
||||
# Module path which contains the source code being formatted.
|
||||
# Default: empty string
|
||||
module-path: github.com/org/project
|
||||
|
||||
# Choose whether to use the extra rules.
|
||||
# Default: false
|
||||
extra-rules: true
|
||||
|
@ -49,6 +49,7 @@ var defaultLintersSettings = LintersSettings{
|
||||
},
|
||||
Gofumpt: GofumptSettings{
|
||||
LangVersion: "",
|
||||
ModulePath: "",
|
||||
ExtraRules: false,
|
||||
},
|
||||
Gosec: GoSecSettings{
|
||||
@ -311,6 +312,7 @@ type GoFmtSettings struct {
|
||||
|
||||
type GofumptSettings struct {
|
||||
LangVersion string `mapstructure:"lang-version"`
|
||||
ModulePath string `mapstructure:"module-path"`
|
||||
ExtraRules bool `mapstructure:"extra-rules"`
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ func NewGofumpt() *goanalysis.Linter {
|
||||
|
||||
options := format.Options{
|
||||
LangVersion: getLangVersion(settings),
|
||||
ModulePath: settings.ModulePath,
|
||||
ExtraRules: settings.ExtraRules,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user