From 42723c84f4fb16023986eac7a01d5084bb7412d8 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 8 Jan 2025 10:46:31 +0100 Subject: [PATCH 1/3] chore: bump golangci-lint and fix config This fixes the CI lint step. No change in code except a fix in test output. --- .golangci.yml | 32 +++++++++++--------------------- interp/interp_eval_test.go | 4 ++-- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bfd41212..a2d12b2f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ run: linters-settings: govet: - check-shadowing: false + shadow: false gocyclo: min-complexity: 12 maligned: @@ -92,22 +92,8 @@ linters-settings: linters: enable-all: true disable: - - deadcode # deprecated - - exhaustivestruct # deprecated - - golint # deprecated - - ifshort # deprecated - - interfacer # deprecated - - maligned # deprecated - - nosnakecase # deprecated - - scopelint # deprecated - - structcheck # deprecated - - varcheck # deprecated - - cyclop # duplicate of gocyclo - - sqlclosecheck # not relevant (SQL) - - rowserrcheck # not relevant (SQL) - - execinquery # not relevant (SQL) - lll - - gas + - gosec - dupl - prealloc - gocyclo @@ -120,25 +106,29 @@ linters: - funlen - gocognit - stylecheck - - gomnd + - mnd - testpackage - paralleltest - tparallel - - goerr113 + - err113 - wrapcheck - nestif - exhaustive - exhaustruct - forbidigo - - ifshort - forcetypeassert - varnamelen - - nosnakecase - nonamedreturns - nilnil - maintidx - dupword # false positives - - errorlint # TODO: must be reactivate after fixes + - errorlint # TODO: enable after fixes + - errcheck # TODO: enable after fixes + - revive # TODO: enable after fixes + - fatcontext # TODO: enable after fixes + - gocritic # TODO: enable after fixes + - predeclared # TODO: enable after fixes + - recvcheck # TODO: enable after fixes issues: exclude-use-default: false diff --git a/interp/interp_eval_test.go b/interp/interp_eval_test.go index 63f01553..1a8fc680 100644 --- a/interp/interp_eval_test.go +++ b/interp/interp_eval_test.go @@ -900,7 +900,7 @@ func eval(t *testing.T, i *interp.Interpreter, src string) reflect.Value { if err != nil { t.Logf("Error: %v", err) if e, ok := err.(interp.Panic); ok { - t.Logf(string(e.Stack)) + t.Log(string(e.Stack)) } t.FailNow() } @@ -922,7 +922,7 @@ func assertEval(t *testing.T, i *interp.Interpreter, src, expectedError, expecte if err != nil { t.Logf("got an error: %v", err) if e, ok := err.(interp.Panic); ok { - t.Logf(string(e.Stack)) + t.Log(string(e.Stack)) } t.FailNow() } From ec7d9b0cf69f6aa251044bdb5e80f07b7de77843 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 8 Jan 2025 10:56:47 +0100 Subject: [PATCH 2/3] bump golangci-lint from 1.56.2 to 1.63.4 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de3c74e3..07fb68ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: env: GO_VERSION: stable - GOLANGCI_LINT_VERSION: v1.56.2 + GOLANGCI_LINT_VERSION: v1.63.4 jobs: From 9cbc016303cf05c3899e4bcdd006305e21a17d23 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 8 Jan 2025 11:49:20 +0100 Subject: [PATCH 3/3] test: fix test check --- interp/interp_consistent_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interp/interp_consistent_test.go b/interp/interp_consistent_test.go index 5178d218..7f70482f 100644 --- a/interp/interp_consistent_test.go +++ b/interp/interp_consistent_test.go @@ -293,8 +293,8 @@ func TestInterpErrorConsistency(t *testing.T) { }, { fileName: "switch13.go", - expectedInterp: "9:2: i is not a type", - expectedExec: "9:7: i (variable of type interface{}) is not a type", + expectedInterp: "is not a type", + expectedExec: "is not a type", }, { fileName: "switch19.go",