From 714b8da8e3b2ea8b8139f7211f2c92af7d8008b2 Mon Sep 17 00:00:00 2001 From: Loong Dai Date: Mon, 11 Jul 2022 14:56:40 +0800 Subject: [PATCH 1/5] upgrade gci Signed-off-by: Loong Dai --- .golangci.reference.yml | 7 ++++--- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index 00c7d56eb00e..e5fa479a5630 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -343,11 +343,12 @@ linters-settings: # Section configuration to compare against. # Section names are case-insensitive and may contain parameters in (). + # The order of sections is standard > default > custom, which has nothing to do with below configuration order. # 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, built in Golang. + - 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= From 8366603451bd0fbdd9d24f850c83657e12de5b8a Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 11 Jul 2022 09:28:46 +0200 Subject: [PATCH 2/5] review --- .golangci.reference.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index e5fa479a5630..e1d538f87076 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -343,12 +343,11 @@ linters-settings: # Section configuration to compare against. # Section names are case-insensitive and may contain parameters in (). - # The order of sections is standard > default > custom, which has nothing to do with below configuration order. # Default: ["standard", "default"] sections: - - standard # standard section, captures all standard packages, built in Golang. - - 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. + - 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 From bedafda77d5abe7ea017bdfd30617be95b6cfe1e Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 11 Jul 2022 09:31:55 +0200 Subject: [PATCH 3/5] review --- test/testdata/fix/out/gci.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() { From ad5fccd87ef1ffd999408709e669047bac25687c Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 11 Jul 2022 09:36:02 +0200 Subject: [PATCH 4/5] review --- .golangci.reference.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.golangci.reference.yml b/.golangci.reference.yml index e1d538f87076..0b09a14d5324 100644 --- a/.golangci.reference.yml +++ b/.golangci.reference.yml @@ -343,6 +343,8 @@ 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 # Standard section: captures all standard packages. From f8ba2ab4b34e93f99d654ba7d0033ff4dbb07b25 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 11 Jul 2022 09:48:55 +0200 Subject: [PATCH 5/5] review --- test/testdata/gci.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() {