From f65d4f68148a852af7ae4fba2d54b19933f7e91e Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 10 May 2021 23:00:33 +0200 Subject: [PATCH 1/3] feat: deprecated golint --- pkg/lint/lintersdb/manager.go | 3 ++- test/testdata/default_exclude.go | 2 +- test/testdata/golint.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index 8b057b342b62..fc760dc34a2e 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -169,7 +169,8 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.0.0"). WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithURL("https://github.com/golang/lint"), + WithURL("https://github.com/golang/lint"). + Deprecated("The repository of the linter has been archived by the owner.", "v1.41.0", "revive"), linter.NewConfig(golinters.NewRowsErrCheck()). WithSince("v1.23.0"). WithLoadForGoAnalysis(). diff --git a/test/testdata/default_exclude.go b/test/testdata/default_exclude.go index beed57ac6757..d5e4422886b2 100644 --- a/test/testdata/default_exclude.go +++ b/test/testdata/default_exclude.go @@ -1,4 +1,4 @@ -//args: -Estylecheck,golint +//args: -Estylecheck,golint --internal-cmd-test //config_path: testdata/configs/default_exclude.yml /*Package testdata ...*/ diff --git a/test/testdata/golint.go b/test/testdata/golint.go index 2fc70ed7ca42..c4e1148e2205 100644 --- a/test/testdata/golint.go +++ b/test/testdata/golint.go @@ -1,4 +1,4 @@ -//args: -Egolint +//args: -Egolint --internal-cmd-test package testdata var Go_lint string // ERROR "don't use underscores in Go names; var `Go_lint` should be `GoLint`" From e45a34625a338c700bb90e9402c22be014db1eb7 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 10 May 2021 23:29:55 +0200 Subject: [PATCH 2/3] drop golint in main configuration. --- .golangci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 500b82b02859..a3e537e4a108 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -34,8 +34,6 @@ linters-settings: min-complexity: 15 goimports: local-prefixes: github.com/golangci/golangci-lint - golint: - min-confidence: 0 gomnd: settings: mnd: @@ -82,7 +80,6 @@ linters: - gocyclo - gofmt - goimports - - golint - gomnd - goprintffuncname - gosec From cbf24d1cb672815b89b2d9977f925fa9b2444c56 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 11 May 2021 00:27:40 +0200 Subject: [PATCH 3/3] golint related tests. --- test/run_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run_test.go b/test/run_test.go index e644b2e93bb1..07a31355c9ce 100644 --- a/test/run_test.go +++ b/test/run_test.go @@ -91,7 +91,7 @@ func TestTimeoutInConfig(t *testing.T) { func TestTestsAreLintedByDefault(t *testing.T) { testshared.NewLintRunner(t).Run(getTestDataDir("withtests")). - ExpectHasIssue("`if` block ends with a `return`") + ExpectHasIssue("don't use `init` function") } func TestCgoOk(t *testing.T) {