Skip to content

Commit 780ba8c

Browse files
jpreeseSeigeC
authored andcommitted
gofumpt: add module-path setting (golangci#2644)
1 parent b240057 commit 780ba8c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.golangci.example.yml

+4
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@ linters-settings:
511511
# Default: 1.15
512512
lang-version: "1.17"
513513

514+
# Module path which contains the source code being formatted.
515+
# Default: empty string
516+
module-path: github.com/org/project
517+
514518
# Choose whether to use the extra rules.
515519
# Default: false
516520
extra-rules: true

pkg/config/linters_settings.go

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ var defaultLintersSettings = LintersSettings{
4949
},
5050
Gofumpt: GofumptSettings{
5151
LangVersion: "",
52+
ModulePath: "",
5253
ExtraRules: false,
5354
},
5455
Gosec: GoSecSettings{
@@ -311,6 +312,7 @@ type GoFmtSettings struct {
311312

312313
type GofumptSettings struct {
313314
LangVersion string `mapstructure:"lang-version"`
315+
ModulePath string `mapstructure:"module-path"`
314316
ExtraRules bool `mapstructure:"extra-rules"`
315317
}
316318

pkg/golinters/gofumpt.go

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func NewGofumpt() *goanalysis.Linter {
3737

3838
options := format.Options{
3939
LangVersion: getLangVersion(settings),
40+
ModulePath: settings.ModulePath,
4041
ExtraRules: settings.ExtraRules,
4142
}
4243

0 commit comments

Comments
 (0)