Skip to content

Commit ffe688c

Browse files
build(deps): bump github.com/4meepo/tagalign from 1.2.2 to 1.3.1 (#3979)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 78462c2 commit ffe688c

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

.golangci.reference.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,11 @@ linters-settings:
18031803
- mapstructure
18041804
- binding
18051805
- validate
1806+
# Whether enable strict style.
1807+
# In this style, the tags will be sorted and aligned in the dictionary order,
1808+
# and the tags with the same name will be aligned together.
1809+
# Default: false
1810+
strict: true
18061811

18071812
tagliatelle:
18081813
# Check the struct tag name case.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.19
55
require (
66
4d63.com/gocheckcompilerdirectives v1.2.1
77
4d63.com/gochecknoglobals v0.2.1
8-
github.com/4meepo/tagalign v1.2.2
8+
github.com/4meepo/tagalign v1.3.1
99
github.com/Abirdcfly/dupword v0.0.12
1010
github.com/Antonboom/errname v0.1.10
1111
github.com/Antonboom/nilnil v0.1.5

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ var defaultLintersSettings = LintersSettings{
114114
Qualified: false,
115115
},
116116
TagAlign: TagAlignSettings{
117-
Align: true,
118-
Sort: true,
119-
Order: nil,
117+
Align: true,
118+
Sort: true,
119+
Order: nil,
120+
Strict: false,
120121
},
121122
Testpackage: TestpackageSettings{
122123
SkipRegexp: `(export|internal)_test\.go`,
@@ -720,9 +721,10 @@ type StructCheckSettings struct {
720721
}
721722

722723
type TagAlignSettings struct {
723-
Align bool `mapstructure:"align"`
724-
Sort bool `mapstructure:"sort"`
725-
Order []string `mapstructure:"order"`
724+
Align bool `mapstructure:"align"`
725+
Sort bool `mapstructure:"sort"`
726+
Order []string `mapstructure:"order"`
727+
Strict bool `mapstructure:"strict"`
726728
}
727729

728730
type TagliatelleSettings struct {

pkg/golinters/tagalign.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func NewTagAlign(settings *config.TagAlignSettings) *goanalysis.Linter {
2424
if settings.Sort || len(settings.Order) > 0 {
2525
options = append(options, tagalign.WithSort(settings.Order...))
2626
}
27+
28+
if settings.Strict {
29+
options = append(options, tagalign.WithStrictStyle())
30+
}
2731
}
2832

2933
analyzer := tagalign.NewAnalyzer(options...)

0 commit comments

Comments
 (0)