add tagalign linter (#3709)

This commit is contained in:
Yifei Liu 2023-03-26 22:35:06 +08:00 committed by GitHub
parent 69f929b227
commit 134f2e0491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 218 additions and 0 deletions

View file

@ -110,6 +110,11 @@ var defaultLintersSettings = LintersSettings{
Ignore: "",
Qualified: false,
},
TagAlign: TagAlignSettings{
Align: true,
Sort: true,
Order: nil,
},
Testpackage: TestpackageSettings{
SkipRegexp: `(export|internal)_test\.go`,
AllowPackages: []string{"main"},
@ -203,6 +208,7 @@ type LintersSettings struct {
Staticcheck StaticCheckSettings
Structcheck StructCheckSettings
Stylecheck StaticCheckSettings
TagAlign TagAlignSettings
Tagliatelle TagliatelleSettings
Tenv TenvSettings
Testpackage TestpackageSettings
@ -655,6 +661,12 @@ type StructCheckSettings struct {
CheckExportedFields bool `mapstructure:"exported-fields"`
}
type TagAlignSettings struct {
Align bool `mapstructure:"align"`
Sort bool `mapstructure:"sort"`
Order []string `mapstructure:"order"`
}
type TagliatelleSettings struct {
Case struct {
Rules map[string]string