Skip to content
Open
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
3 changes: 3 additions & 0 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ linters:
# Allows empty structures in variable declarations.
# Default: false
allow-empty-declarations: true
# Allow empty literals the blank identifier receives.
# Default: false
allow-empty-blank-assignments: true
# When true, only types marked with //exhaustruct:enforce directive or matching enforce-rx patterns are checked.
# Default: false
explicit-mode: true
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
charm.land/lipgloss/v2 v2.0.6
codeberg.org/polyfloyd/go-errorlint v1.9.0
dev.gaijin.team/go/exhaustruct/v4 v4.0.0
dev.gaijin.team/go/exhaustruct/v5 v5.0.3
dev.gaijin.team/go/exhaustruct/v5 v5.2.0
github.com/4meepo/tagalign v1.4.4
github.com/Abirdcfly/dupword v0.1.8
github.com/AdminBenni/iota-mixing v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions jsonschema/golangci.next.jsonschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,11 @@
"type": "boolean",
"default": false
},
"allow-empty-blank-assignments": {
"description": "Allow empty literals the blank identifier receives.",
"type": "boolean",
"default": false
},
"explicit-mode":{
"description": "When true, only types marked with //exhaustruct:enforce directive or matching enforce-rx patterns are checked.",
"type": "boolean",
Expand Down
17 changes: 9 additions & 8 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,15 @@ type ExhaustructSettings struct {
}

type ExhaustructV5Settings struct {
EnforcePatterns []string `mapstructure:"enforce-patterns"`
IgnorePatterns []string `mapstructure:"ignore-patterns"`
OptionalPatterns []string `mapstructure:"optional-patterns"`
AllowEmpty bool `mapstructure:"allow-empty"`
AllowEmptyPatterns []string `mapstructure:"allow-empty-patterns"`
AllowEmptyReturns bool `mapstructure:"allow-empty-returns"`
AllowEmptyDeclarations bool `mapstructure:"allow-empty-declarations"`
ExplicitMode bool `mapstructure:"explicit-mode"`
EnforcePatterns []string `mapstructure:"enforce-patterns"`
IgnorePatterns []string `mapstructure:"ignore-patterns"`
OptionalPatterns []string `mapstructure:"optional-patterns"`
AllowEmpty bool `mapstructure:"allow-empty"`
AllowEmptyPatterns []string `mapstructure:"allow-empty-patterns"`
AllowEmptyReturns bool `mapstructure:"allow-empty-returns"`
AllowEmptyDeclarations bool `mapstructure:"allow-empty-declarations"`
AllowEmptyBlankAssignments bool `mapstructure:"allow-empty-blank-assignments"`
ExplicitMode bool `mapstructure:"explicit-mode"`
}

type FatcontextSettings struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/exhaustruct/exhaustruct_v5.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func NewV5(settings *config.ExhaustructV5Settings) *goanalysis.Linter {
cfg.AllowEmptyPatterns = settings.AllowEmptyPatterns
cfg.AllowEmptyReturns = settings.AllowEmptyReturns
cfg.AllowEmptyDeclarations = settings.AllowEmptyDeclarations
cfg.AllowEmptyBlankAssignments = settings.AllowEmptyBlankAssignments
cfg.ExplicitMode = settings.ExplicitMode
}

Expand Down
Loading