Skip to content

Commit e555470

Browse files
authored
build(deps): bump github.com/4meepo/tagalign from 1.3.1 to 1.3.2 (#3980)
1 parent ffe688c commit e555470

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed

.golangci.reference.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,7 @@ linters-settings:
18061806
# Whether enable strict style.
18071807
# In this style, the tags will be sorted and aligned in the dictionary order,
18081808
# and the tags with the same name will be aligned together.
1809+
# Note: This option will be ignored if 'align' or 'sort' is false.
18091810
# Default: false
18101811
strict: true
18111812

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.3.1
8+
github.com/4meepo/tagalign v1.3.2
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 & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/tagalign.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func NewTagAlign(settings *config.TagAlignSettings) *goanalysis.Linter {
2525
options = append(options, tagalign.WithSort(settings.Order...))
2626
}
2727

28-
if settings.Strict {
28+
// Strict style will be applied only if Align and Sort are enabled together.
29+
if settings.Strict && settings.Align && settings.Sort {
2930
options = append(options, tagalign.WithStrictStyle())
3031
}
3132
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
linters-settings:
2+
tagalign:
3+
align: true
4+
sort: true
5+
strict: true

test/testdata/tagalign_strict.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//golangcitest:args -Etagalign
2+
//golangcitest:config_path testdata/configs/tagalign_strict.yml
3+
package testdata
4+
5+
import "time"
6+
7+
type TagAlignExampleStrictKO struct {
8+
Foo time.Time `json:"foo,omitempty" validate:"required" zip:"foo"` // want ` json:"foo,omitempty" validate:"required" zip:"foo"`
9+
FooBar struct{} `gorm:"column:fooBar" validate:"required" zip:"fooBar" xml:"fooBar" json:"fooBar,omitempty" yaml:"fooBar"` // want `gorm:"column:fooBar" json:"fooBar,omitempty" validate:"required" xml:"fooBar" yaml:"fooBar" zip:"fooBar"`
10+
}

0 commit comments

Comments
 (0)