From c2febbbd381f88f8278b30ac7d073cb1ddb7a1a5 Mon Sep 17 00:00:00 2001 From: ptrus Date: Wed, 18 Dec 2024 13:28:07 +0100 Subject: [PATCH] Update golangci-lint to 1.62.2 --- .github/workflows/ci-lint.yaml | 2 +- .golangci.yaml | 12 ++++++++---- README.md | 2 +- log/log_test.go | 1 - storage/postgres/client_test.go | 1 - 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-lint.yaml b/.github/workflows/ci-lint.yaml index 0d427fe66..d55de1685 100644 --- a/.github/workflows/ci-lint.yaml +++ b/.github/workflows/ci-lint.yaml @@ -94,6 +94,6 @@ jobs: uses: golangci/golangci-lint-action@v3 with: # Update README.md instructions when bumping this. - version: v1.55.1 + version: v1.62.2 # Always run this step so that all linting errors can be seen at once. if: always() diff --git a/.golangci.yaml b/.golangci.yaml index e01e2659f..31b9e0e9a 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -5,13 +5,14 @@ run: timeout: 5m - skip-dirs: + +issues: + exclude-dirs: # Contains a cloned subset of oasis-core. Some types are unused, some # formatting is haphazard. We don't care much; this code is meant to be # frozen in time. - coreapi -issues: exclude-rules: - path: '(.+)_test\.go' linters: @@ -36,7 +37,6 @@ linters: - dogsled - errcheck - exhaustive - - exportloopref - goconst - gocritic - gocyclo @@ -74,7 +74,11 @@ linters-settings: default-signifies-exhaustive: true govet: # Enabled checking for shadowed variables. - check-shadowing: true + shadow: true + gosec: + excludes: + # https://github.com/securego/gosec#available-rules + - G115 goimports: # Put local imports after 3rd-party packages. local-prefixes: github.com/oasisprotocol/nexus diff --git a/README.md b/README.md index ebf6f7ba5..238bf9034 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ create a PR, but without them, you're at the mercy of CI. ```sh curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \ - | sh -s -- -b $(go env GOPATH)/bin v1.55.1 + | sh -s -- -b $(go env GOPATH)/bin v1.62.2 ``` - **gofumpt**: `go install mvdan.cc/gofumpt@latest` diff --git a/log/log_test.go b/log/log_test.go index 44063a44e..4b93b7b9f 100644 --- a/log/log_test.go +++ b/log/log_test.go @@ -28,7 +28,6 @@ func TestLoggerJSON(t *testing.T) { require.NoError(t, err) l.Debug("a statement") - //nolint:goconst require.Regexp(t, regexp.MustCompile( `{"caller":"log_test\.go:\d{1,4}","level":"debug","module":"log-test","msg":"a statement","ts":"`+tsRegex+`"}\n`), b.String()) diff --git a/storage/postgres/client_test.go b/storage/postgres/client_test.go index f321037eb..492bd9872 100644 --- a/storage/postgres/client_test.go +++ b/storage/postgres/client_test.go @@ -66,7 +66,6 @@ func TestInvalidQuery(t *testing.T) { client := testutil.NewTestClient(t) defer client.Close() - //nolint:sqlclosecheck _, err := client.Query(context.Background(), ` an invalid query `)