build(deps): bump github.com/daixiang0/gci from 0.13.4 to 0.13.5 (#4975)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
54d089d106
commit
726b8153ca
@ -464,6 +464,10 @@ linters-settings:
|
||||
# Default: false
|
||||
custom-order: true
|
||||
|
||||
# Drops lexical ordering for custom sections.
|
||||
# Default: false
|
||||
no-lex-order: true
|
||||
|
||||
ginkgolinter:
|
||||
# Suppress the wrong length assertion warning.
|
||||
# Default: false
|
||||
|
2
go.mod
2
go.mod
@ -32,7 +32,7 @@ require (
|
||||
github.com/charithe/durationcheck v0.0.10
|
||||
github.com/ckaznocha/intrange v0.1.2
|
||||
github.com/curioswitch/go-reassign v0.2.0
|
||||
github.com/daixiang0/gci v0.13.4
|
||||
github.com/daixiang0/gci v0.13.5
|
||||
github.com/denis-tingaikin/go-header v0.5.0
|
||||
github.com/fatih/color v1.17.0
|
||||
github.com/firefart/nonamedreturns v1.0.5
|
||||
|
4
go.sum
generated
4
go.sum
generated
@ -122,8 +122,8 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo=
|
||||
github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc=
|
||||
github.com/daixiang0/gci v0.13.4 h1:61UGkmpoAcxHM2hhNkZEf5SzwQtWJXTSws7jaPyqwlw=
|
||||
github.com/daixiang0/gci v0.13.4/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk=
|
||||
github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c=
|
||||
github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
@ -1103,6 +1103,11 @@
|
||||
"description": "Enable custom order of sections.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"no-lex-order": {
|
||||
"description": "Drops lexical ordering for custom sections.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -465,6 +465,7 @@ type GciSettings struct {
|
||||
Sections []string `mapstructure:"sections"`
|
||||
SkipGenerated bool `mapstructure:"skip-generated"`
|
||||
CustomOrder bool `mapstructure:"custom-order"`
|
||||
NoLexOrder bool `mapstructure:"no-lex-order"`
|
||||
|
||||
// Deprecated: use Sections instead.
|
||||
LocalPrefixes string `mapstructure:"local-prefixes"`
|
||||
|
@ -44,6 +44,7 @@ func New(settings *config.GciSettings) *goanalysis.Linter {
|
||||
Cfg: gcicfg.BoolConfig{
|
||||
SkipGenerated: settings.SkipGenerated,
|
||||
CustomOrder: settings.CustomOrder,
|
||||
NoLexOrder: settings.NoLexOrder,
|
||||
},
|
||||
SectionStrings: settings.Sections,
|
||||
}
|
||||
@ -195,7 +196,7 @@ func diffFormattedFilesToArray(paths []string, cfg gcicfg.Config, diffs *[]strin
|
||||
}
|
||||
|
||||
// Code below this comment is borrowed and modified from gci.
|
||||
// https://github.com/daixiang0/gci/blob/4725b0c101801e7449530eee2ddb0c72592e3405/pkg/config/config.go
|
||||
// https://github.com/daixiang0/gci/blob/v0.13.5/pkg/config/config.go
|
||||
|
||||
var defaultOrder = map[string]int{
|
||||
section.StandardType: 0,
|
||||
@ -229,10 +230,11 @@ func (g YamlConfig) Parse() (*gcicfg.Config, error) {
|
||||
sort.Slice(sections, func(i, j int) bool {
|
||||
sectionI, sectionJ := sections[i].Type(), sections[j].Type()
|
||||
|
||||
if strings.Compare(sectionI, sectionJ) == 0 {
|
||||
return strings.Compare(sections[i].String(), sections[j].String()) < 0
|
||||
if g.origin.Cfg.NoLexOrder || strings.Compare(sectionI, sectionJ) != 0 {
|
||||
return defaultOrder[sectionI] < defaultOrder[sectionJ]
|
||||
}
|
||||
return defaultOrder[sectionI] < defaultOrder[sectionJ]
|
||||
|
||||
return strings.Compare(sections[i].String(), sections[j].String()) < 0
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user