Skip to content

Commit

Permalink
build(deps): bump github.com/4meepo/tagalign from 1.2.2 to 1.3.1 (#3979)
Browse files Browse the repository at this point in the history
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ldez committed Jul 27, 2023
1 parent 78462c2 commit ffe688c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
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

0 comments on commit ffe688c

Please sign in to comment.