From 311d5b2001c367d26066bc53389b178930b2632a Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Mon, 12 Oct 2020 20:57:08 +0530 Subject: [PATCH 01/11] update exhaustive to latest --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index ba055a9a4133..b155bc9fae92 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/mitchellh/go-ps v1.0.0 github.com/moricho/tparallel v0.2.1 github.com/nakabonne/nestif v0.3.0 - github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0 + github.com/nishanths/exhaustive v0.0.0-20201012211509-7221e29c71f4 github.com/pkg/errors v0.9.1 github.com/polyfloyd/go-errorlint v0.0.0-20201006195004-351e25ade6e3 github.com/ryancurrah/gomodguard v1.1.0 @@ -62,7 +62,7 @@ require ( github.com/ultraware/whitespace v0.0.4 github.com/uudashr/gocognit v1.0.1 github.com/valyala/quicktemplate v1.6.3 - golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c + golang.org/x/tools v0.0.0-20201011145850-ed2f50202694 gopkg.in/yaml.v2 v2.3.0 honnef.co/go/tools v0.0.1-2020.1.6 mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d diff --git a/go.sum b/go.sum index 6750f42d0eae..7bdfb8bb85b3 100644 --- a/go.sum +++ b/go.sum @@ -272,8 +272,8 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1 github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0 h1:eMV1t2NQRc3r1k3guWiv/zEeqZZP6kPvpUfy6byfL1g= -github.com/nishanths/exhaustive v0.0.0-20200811152831-6cf413ae40e0/go.mod h1:wBEpHwM2OdmeNpdCvRPUlkEbBuaFmcK4Wv8Q7FuGW3c= +github.com/nishanths/exhaustive v0.0.0-20201012211509-7221e29c71f4 h1:4VipxLNGOCiykUWtOU+qF7h8f4HBMQGkHAY4NIblTH4= +github.com/nishanths/exhaustive v0.0.0-20201012211509-7221e29c71f4/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -538,7 +538,6 @@ golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200519015757-0d0afa43d58a/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200701041122-1837592efa10/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -548,6 +547,8 @@ golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c h1:9BSeO6440XJVa2mxIcRAndAol4g4g2KflCVGcHx9Yu8= golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201011145850-ed2f50202694 h1:BANdcOVw3KTuUiyfDp7wrzCpkCe8UP3lowugJngxBTg= +golang.org/x/tools v0.0.0-20201011145850-ed2f50202694/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 80b87f5a7389bd7812924c55bea318ab8a560232 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:01:08 +0530 Subject: [PATCH 02/11] wip --- .golangci.example.yml | 12 +++++++----- .golangci.yml | 1 + pkg/config/config.go | 2 ++ pkg/golinters/exhaustive.go | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.golangci.example.yml b/.golangci.example.yml index 61190bfe19e4..5fd1432e9dad 100644 --- a/.golangci.example.yml +++ b/.golangci.example.yml @@ -102,6 +102,8 @@ linters-settings: # see https://github.com/kisielk/errcheck#excluding-functions for details exclude: /path/to/file.txt exhaustive: + # check switch statements in generated files also + check-generated: false # indicates that switch statements are to be considered exhaustive if a # 'default' case is present, even if all enum members aren't listed in the # switch @@ -432,22 +434,22 @@ issues: severity: # Default value is empty string. - # Set the default severity for issues. If severity rules are defined and the issues - # do not match or no severity is provided to the rule this will be the default - # severity applied. Severities should match the supported severity names of the + # Set the default severity for issues. If severity rules are defined and the issues + # do not match or no severity is provided to the rule this will be the default + # severity applied. Severities should match the supported severity names of the # selected out format. # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#severity # - Github: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message default-severity: error - # The default value is false. + # The default value is false. # If set to true severity-rules regular expressions become case sensitive. case-sensitive: false # Default value is empty list. # When a list of severity rules are provided, severity information will be added to lint - # issues. Severity rules have the same filtering capability as exclude rules except you + # issues. Severity rules have the same filtering capability as exclude rules except you # are allowed to specify one matcher per severity rule. # Only affects out formats that support setting severity information. rules: diff --git a/.golangci.yml b/.golangci.yml index 5e9e1e7c2cb1..54779196c9ba 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -10,6 +10,7 @@ linters-settings: dupl: threshold: 100 exhaustive: + check-generated: false default-signifies-exhaustive: false funlen: lines: 100 diff --git a/pkg/config/config.go b/pkg/config/config.go index 3f42c6049e94..5b73a36de349 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -354,6 +354,7 @@ type NestifSettings struct { } type ExhaustiveSettings struct { + CheckGenerated bool `mapstructure:"check-generated"` DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"` } @@ -416,6 +417,7 @@ var defaultLintersSettings = LintersSettings{ MinComplexity: 5, }, Exhaustive: ExhaustiveSettings{ + CheckGenerated: false, DefaultSignifiesExhaustive: false, }, Gofumpt: GofumptSettings{ diff --git a/pkg/golinters/exhaustive.go b/pkg/golinters/exhaustive.go index cae37ecc61d3..61b0d3fe45e5 100644 --- a/pkg/golinters/exhaustive.go +++ b/pkg/golinters/exhaustive.go @@ -15,6 +15,7 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter { if settings != nil { cfg = map[string]map[string]interface{}{ a.Name: { + exhaustive.CheckGeneratedFilesFlag: settings.CheckGenerated, exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive, }, } From e9f11ee06a0d713083485e3fefe5176c39d160af Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:03:01 +0530 Subject: [PATCH 03/11] update dep --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b155bc9fae92..18998a97be45 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/mitchellh/go-ps v1.0.0 github.com/moricho/tparallel v0.2.1 github.com/nakabonne/nestif v0.3.0 - github.com/nishanths/exhaustive v0.0.0-20201012211509-7221e29c71f4 + github.com/nishanths/exhaustive v0.0.0-20201012213148-ec67bea5141e github.com/pkg/errors v0.9.1 github.com/polyfloyd/go-errorlint v0.0.0-20201006195004-351e25ade6e3 github.com/ryancurrah/gomodguard v1.1.0 diff --git a/go.sum b/go.sum index 7bdfb8bb85b3..1362a6e0670c 100644 --- a/go.sum +++ b/go.sum @@ -272,8 +272,8 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1 github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.0.0-20201012211509-7221e29c71f4 h1:4VipxLNGOCiykUWtOU+qF7h8f4HBMQGkHAY4NIblTH4= -github.com/nishanths/exhaustive v0.0.0-20201012211509-7221e29c71f4/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= +github.com/nishanths/exhaustive v0.0.0-20201012213148-ec67bea5141e h1:OvUdHSYbRVJw5EFYs308Zf3c77vzqwNZ6SspievTLHk= +github.com/nishanths/exhaustive v0.0.0-20201012213148-ec67bea5141e/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= From 309efdd550d6f1f607ac111dfcb96caf16dad8a1 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:03:31 +0530 Subject: [PATCH 04/11] update flag name --- pkg/golinters/exhaustive.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/golinters/exhaustive.go b/pkg/golinters/exhaustive.go index 61b0d3fe45e5..85534d42cda8 100644 --- a/pkg/golinters/exhaustive.go +++ b/pkg/golinters/exhaustive.go @@ -15,7 +15,7 @@ func NewExhaustive(settings *config.ExhaustiveSettings) *goanalysis.Linter { if settings != nil { cfg = map[string]map[string]interface{}{ a.Name: { - exhaustive.CheckGeneratedFilesFlag: settings.CheckGenerated, + exhaustive.CheckGeneratedFlag: settings.CheckGenerated, exhaustive.DefaultSignifiesExhaustiveFlag: settings.DefaultSignifiesExhaustive, }, } From e3e0131f094c78255a6e202f5689d3e9a5cf0443 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:22:17 +0530 Subject: [PATCH 05/11] use versioned dep --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 18998a97be45..3181521932db 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/mitchellh/go-ps v1.0.0 github.com/moricho/tparallel v0.2.1 github.com/nakabonne/nestif v0.3.0 - github.com/nishanths/exhaustive v0.0.0-20201012213148-ec67bea5141e + github.com/nishanths/exhaustive v0.1.0 github.com/pkg/errors v0.9.1 github.com/polyfloyd/go-errorlint v0.0.0-20201006195004-351e25ade6e3 github.com/ryancurrah/gomodguard v1.1.0 diff --git a/go.sum b/go.sum index 1362a6e0670c..20c84de10a36 100644 --- a/go.sum +++ b/go.sum @@ -272,8 +272,8 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1 github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.0.0-20201012213148-ec67bea5141e h1:OvUdHSYbRVJw5EFYs308Zf3c77vzqwNZ6SspievTLHk= -github.com/nishanths/exhaustive v0.0.0-20201012213148-ec67bea5141e/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= +github.com/nishanths/exhaustive v0.1.0 h1:kVlMw8h2LHPMGUVqUj6230oQjjTMFjwcZrnkhXzFfl8= +github.com/nishanths/exhaustive v0.1.0/go.mod h1:S1j9110vxV1ECdCudXRkeMnFQ/DQk9ajLT0Uf2MYZQQ= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= From 555fe8127878623a4559ca8dc40771ee5c23d422 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:35:03 +0530 Subject: [PATCH 06/11] add tests --- .../configs/exhaustive_check_generated.yml | 3 +++ .../{exhaustive.yml => exhaustive_default.yml} | 0 test/testdata/configs/exhaustive_generated.yml | 3 +++ test/testdata/exhaustive_default.go | 2 +- test/testdata/exhaustive_generated.go | 15 +++++++++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/testdata/configs/exhaustive_check_generated.yml rename test/testdata/configs/{exhaustive.yml => exhaustive_default.yml} (100%) create mode 100644 test/testdata/configs/exhaustive_generated.yml create mode 100644 test/testdata/exhaustive_generated.go diff --git a/test/testdata/configs/exhaustive_check_generated.yml b/test/testdata/configs/exhaustive_check_generated.yml new file mode 100644 index 000000000000..d82a3373a266 --- /dev/null +++ b/test/testdata/configs/exhaustive_check_generated.yml @@ -0,0 +1,3 @@ +linters-settings: + exhaustive: + check-generated: false diff --git a/test/testdata/configs/exhaustive.yml b/test/testdata/configs/exhaustive_default.yml similarity index 100% rename from test/testdata/configs/exhaustive.yml rename to test/testdata/configs/exhaustive_default.yml diff --git a/test/testdata/configs/exhaustive_generated.yml b/test/testdata/configs/exhaustive_generated.yml new file mode 100644 index 000000000000..d82a3373a266 --- /dev/null +++ b/test/testdata/configs/exhaustive_generated.yml @@ -0,0 +1,3 @@ +linters-settings: + exhaustive: + check-generated: false diff --git a/test/testdata/exhaustive_default.go b/test/testdata/exhaustive_default.go index 36c1dee6ed03..1dc2637fd198 100644 --- a/test/testdata/exhaustive_default.go +++ b/test/testdata/exhaustive_default.go @@ -1,5 +1,5 @@ //args: -Eexhaustive -//config_path: testdata/configs/exhaustive.yml +//config_path: testdata/configs/exhaustive_default.yml package testdata type Direction int diff --git a/test/testdata/exhaustive_generated.go b/test/testdata/exhaustive_generated.go new file mode 100644 index 000000000000..ad89bfe82496 --- /dev/null +++ b/test/testdata/exhaustive_generated.go @@ -0,0 +1,15 @@ +//args: -Eexhaustive +//config_path: testdata/configs/exhaustive_generated.yml +package testdata + +// Code generated by some program. DO NOT EDIT. + +// Should not report missing cases in the switch statement below, because this +// is a generated file as indicated by the above comment +// (golang.org/s/generatedcode). + +func processDirectionGenerated(d Direction) { + switch d { + case North, South: + } +} From d61cd5b78a5deb2964f1c324630badc84f1485b5 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:36:07 +0530 Subject: [PATCH 07/11] unused file --- test/testdata/configs/exhaustive_check_generated.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 test/testdata/configs/exhaustive_check_generated.yml diff --git a/test/testdata/configs/exhaustive_check_generated.yml b/test/testdata/configs/exhaustive_check_generated.yml deleted file mode 100644 index d82a3373a266..000000000000 --- a/test/testdata/configs/exhaustive_check_generated.yml +++ /dev/null @@ -1,3 +0,0 @@ -linters-settings: - exhaustive: - check-generated: false From 28424aeabb476de9ef5fd130a9f86a694e27f7c8 Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:38:46 +0530 Subject: [PATCH 08/11] no need config file --- test/testdata/configs/exhaustive_generated.yml | 3 --- test/testdata/exhaustive_generated.go | 1 - 2 files changed, 4 deletions(-) delete mode 100644 test/testdata/configs/exhaustive_generated.yml diff --git a/test/testdata/configs/exhaustive_generated.yml b/test/testdata/configs/exhaustive_generated.yml deleted file mode 100644 index d82a3373a266..000000000000 --- a/test/testdata/configs/exhaustive_generated.yml +++ /dev/null @@ -1,3 +0,0 @@ -linters-settings: - exhaustive: - check-generated: false diff --git a/test/testdata/exhaustive_generated.go b/test/testdata/exhaustive_generated.go index ad89bfe82496..48221bca3767 100644 --- a/test/testdata/exhaustive_generated.go +++ b/test/testdata/exhaustive_generated.go @@ -1,5 +1,4 @@ //args: -Eexhaustive -//config_path: testdata/configs/exhaustive_generated.yml package testdata // Code generated by some program. DO NOT EDIT. From 37bf29f190be4e5d38492340f737b703b2c780dd Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:45:18 +0530 Subject: [PATCH 09/11] add vars to test --- test/testdata/exhaustive_generated.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testdata/exhaustive_generated.go b/test/testdata/exhaustive_generated.go index 48221bca3767..6d6e4c52ae59 100644 --- a/test/testdata/exhaustive_generated.go +++ b/test/testdata/exhaustive_generated.go @@ -7,6 +7,15 @@ package testdata // is a generated file as indicated by the above comment // (golang.org/s/generatedcode). +type Direction int + +const ( + North Direction = iota + East + South + West +) + func processDirectionGenerated(d Direction) { switch d { case North, South: From 4de2c2e3acdcde9d098ff3286a97c8567e314d2c Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 03:46:43 +0530 Subject: [PATCH 10/11] test comment --- test/testdata/exhaustive_generated.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testdata/exhaustive_generated.go b/test/testdata/exhaustive_generated.go index 6d6e4c52ae59..ab9a351d6192 100644 --- a/test/testdata/exhaustive_generated.go +++ b/test/testdata/exhaustive_generated.go @@ -5,7 +5,7 @@ package testdata // Should not report missing cases in the switch statement below, because this // is a generated file as indicated by the above comment -// (golang.org/s/generatedcode). +// (golang.org/s/generatedcode), and check-generated setting is false. type Direction int From 1fa8c513ecf3c16832481fd1f6f8295a56ca448b Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Tue, 13 Oct 2020 19:00:53 +0530 Subject: [PATCH 11/11] remove default settings --- .golangci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 54779196c9ba..012255c281b4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,9 +9,6 @@ linters-settings: - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" dupl: threshold: 100 - exhaustive: - check-generated: false - default-signifies-exhaustive: false funlen: lines: 100 statements: 50