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