Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var defaultLintersSettings = LintersSettings{
},
Gofumpt: GofumptSettings{
LangVersion: "",
ModulePath: "",
ExtraRules: false,
},
Gosec: GoSecSettings{
Expand Down Expand Up @@ -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"`
}

Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/gofumpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func NewGofumpt() *goanalysis.Linter {

options := format.Options{
LangVersion: getLangVersion(settings),
ModulePath: settings.ModulePath,
ExtraRules: settings.ExtraRules,
}

Expand Down