diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 00c7d56eb00e..0b09a14d5324 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -343,11 +343,13 @@ linters-settings: # Section configuration to compare against. # Section names are case-insensitive and may contain parameters in (). + # The order of sections is always `standard > default > custom`, + # it cannot be changed and doesn't follow the order of `sections` option. # Default: ["standard", "default"] sections: - - standard # Captures all standard packages if they do not match another section. - - default # Contains all imports that could not be matched to another section type. - - prefix(github.com/org/project) # Groups all imports with the specified Prefix. + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix. # Skip generated files. # Default: true diff --git a/go.mod b/go.mod index f1a9a7b0dac7..87001c2ac3a8 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/breml/errchkjson v0.3.0 github.com/butuzov/ireturn v0.1.1 github.com/charithe/durationcheck v0.0.9 - github.com/daixiang0/gci v0.4.0 + github.com/daixiang0/gci v0.4.1 github.com/denis-tingaikin/go-header v0.4.3 github.com/esimonov/ifshort v1.0.4 github.com/fatih/color v1.13.0 diff --git a/go.sum b/go.sum index ad2e581d6471..859cc373e0f5 100644 --- a/go.sum +++ b/go.sum @@ -129,8 +129,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daixiang0/gci v0.4.0 h1:WKWAjTsU05SQjDRpeyiJdYo4Jfh8nWpgctffJuqBXmc= -github.com/daixiang0/gci v0.4.0/go.mod h1:d0f+IJhr9loBtIq+ebwhRoTt1LGbPH96ih8bKlsRT9E= +github.com/daixiang0/gci v0.4.1 h1:X2S5Vvlm24kiptIVY6+zKZD9pqI9qKww6JgAfbciSRE= +github.com/daixiang0/gci v0.4.1/go.mod h1:d0f+IJhr9loBtIq+ebwhRoTt1LGbPH96ih8bKlsRT9E= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= diff --git a/test/testdata/fix/out/gci.go b/test/testdata/fix/out/gci.go index a9dfbb07d76e..c35c11ac7871 100644 --- a/test/testdata/fix/out/gci.go +++ b/test/testdata/fix/out/gci.go @@ -5,9 +5,9 @@ package gci import ( "fmt" - "github.com/golangci/golangci-lint/pkg/config" - "github.com/pkg/errors" + + "github.com/golangci/golangci-lint/pkg/config" ) func GoimportsLocalTest() { diff --git a/test/testdata/gci.go b/test/testdata/gci.go index 8f4190a20fe2..66effef786b6 100644 --- a/test/testdata/gci.go +++ b/test/testdata/gci.go @@ -5,9 +5,9 @@ package testdata import ( "fmt" - "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/config" // ERROR "File is not \\`gci\\`-ed with -skip-generated -s standard,prefix\\(github.com/golangci/golangci-lint\\),default" - "github.com/pkg/errors" + "github.com/pkg/errors" // ERROR "File is not \\`gci\\`-ed with -skip-generated -s standard,prefix\\(github.com/golangci/golangci-lint\\),default" ) func GoimportsLocalTest() {