Skip to content

build(deps): bump github.com/4meepo/tagalign from 1.2.2 to 1.3.1 #3979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
5 changes: 5 additions & 0 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,11 @@ linters-settings:
- mapstructure
- binding
- validate
# Whether enable strict style.
# In this style, the tags will be sorted and aligned in the dictionary order,
# and the tags with the same name will be aligned together.
# Default: false
strict: true

tagliatelle:
# Check the struct tag name case.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
4d63.com/gocheckcompilerdirectives v1.2.1
4d63.com/gochecknoglobals v0.2.1
github.com/4meepo/tagalign v1.2.2
github.com/4meepo/tagalign v1.3.1
github.com/Abirdcfly/dupword v0.0.12
github.com/Antonboom/errname v0.1.10
github.com/Antonboom/nilnil v0.1.5
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.

14 changes: 8 additions & 6 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ var defaultLintersSettings = LintersSettings{
Qualified: false,
},
TagAlign: TagAlignSettings{
Align: true,
Sort: true,
Order: nil,
Align: true,
Sort: true,
Order: nil,
Strict: false,
},
Testpackage: TestpackageSettings{
SkipRegexp: `(export|internal)_test\.go`,
Expand Down Expand Up @@ -720,9 +721,10 @@ type StructCheckSettings struct {
}

type TagAlignSettings struct {
Align bool `mapstructure:"align"`
Sort bool `mapstructure:"sort"`
Order []string `mapstructure:"order"`
Align bool `mapstructure:"align"`
Sort bool `mapstructure:"sort"`
Order []string `mapstructure:"order"`
Strict bool `mapstructure:"strict"`
}

type TagliatelleSettings struct {
Expand Down
4 changes: 4 additions & 0 deletions pkg/golinters/tagalign.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ func NewTagAlign(settings *config.TagAlignSettings) *goanalysis.Linter {
if settings.Sort || len(settings.Order) > 0 {
options = append(options, tagalign.WithSort(settings.Order...))
}

if settings.Strict {
options = append(options, tagalign.WithStrictStyle())
}
}

analyzer := tagalign.NewAnalyzer(options...)
Expand Down