From b34072b6f41701ec7f230e853b654b85f739a5e7 Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Mon, 16 Sep 2024 19:20:21 +0300 Subject: [PATCH 1/4] chore: Update golangci-lint to version 1.61.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1bddce65e9..546dd7cb79 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ install-mockgen: go install go.uber.org/mock/mockgen@latest install-golangci-lint: - @which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 + @which golangci-lint || go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 lint: install-golangci-lint golangci-lint run From 103dc21e4dd197b601ecd6f886f445cbb19db80c Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Mon, 16 Sep 2024 21:14:57 +0300 Subject: [PATCH 2/4] chore: Exclude G115 from gosec linter Exclude G115 from the gosec linter to address the issue with https://github.com/securego/gosec/issues/1212. --- .golangci.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 8838350c20..bfd9f863bb 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -67,6 +67,10 @@ linters-settings: exhaustruct: include: [] + gosec: + excludes: + - G115 #TODO: remove after fixing https://github.com/securego/gosec/issues/1212 + linters: disable-all: true enable: @@ -75,7 +79,7 @@ linters: - dogsled - dupl - errcheck - - exportloopref + - copyloopvar - funlen - gochecknoinits - goconst @@ -108,14 +112,12 @@ linters: # don't enable: # - asciicheck - # - scopelint # - gochecknoglobals # - gocognit # - godot # - godox - # - goerr113 + # - err113 # - interfacer - # - maligned # - nestif # - prealloc # - testpackage From 2695bf7584c2702525096ca581172c026a02a91f Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Mon, 16 Sep 2024 21:15:18 +0300 Subject: [PATCH 3/4] chore: Remove unused variable assignments Remove unused variable assignments in node/node.go and utils/pipeline/pipeline_test.go files. --- node/node.go | 1 - utils/pipeline/pipeline_test.go | 1 - 2 files changed, 2 deletions(-) diff --git a/node/node.go b/node/node.go index 1f211cd808..abd0b93990 100644 --- a/node/node.go +++ b/node/node.go @@ -352,7 +352,6 @@ func (n *Node) Run(ctx context.Context) { } for _, s := range n.services { - s := s wg.Go(func() { // Immediately acknowledge panicing services by shutting down the node // Without the deffered cancel(), we would have to wait for user to hit Ctrl+C diff --git a/utils/pipeline/pipeline_test.go b/utils/pipeline/pipeline_test.go index 5b5156d109..91341240f7 100644 --- a/utils/pipeline/pipeline_test.go +++ b/utils/pipeline/pipeline_test.go @@ -52,7 +52,6 @@ func TestPipeline(t *testing.T) { var chs []<-chan string for n := range nums { - n := n strCh := make(chan string) go func() { defer close(strCh) From 03ea7a6a8dcb7e1e8a2d495b4620f1b085752401 Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Mon, 16 Sep 2024 21:15:32 +0300 Subject: [PATCH 4/4] chore: Remove unused nolint directives Remove unused nolint directives in the starknet client.go and handlers.go files. --- p2p/starknet/client.go | 2 -- p2p/starknet/handlers.go | 2 -- 2 files changed, 4 deletions(-) diff --git a/p2p/starknet/client.go b/p2p/starknet/client.go index 1a80eaf62e..ada3fbd209 100644 --- a/p2p/starknet/client.go +++ b/p2p/starknet/client.go @@ -1,7 +1,5 @@ package starknet -// TODO: remove this nolint when the issue is fixed https://github.com/daixiang0/gci/issues/209 -//nolint:gci import ( "context" "errors" diff --git a/p2p/starknet/handlers.go b/p2p/starknet/handlers.go index bbddda3076..28c4eee5f3 100644 --- a/p2p/starknet/handlers.go +++ b/p2p/starknet/handlers.go @@ -1,8 +1,6 @@ //go:generate protoc --go_out=./ --proto_path=./ --go_opt=Mp2p/proto/transaction.proto=./spec --go_opt=Mp2p/proto/state.proto=./spec --go_opt=Mp2p/proto/snapshot.proto=./spec --go_opt=Mp2p/proto/receipt.proto=./spec --go_opt=Mp2p/proto/mempool.proto=./spec --go_opt=Mp2p/proto/event.proto=./spec --go_opt=Mp2p/proto/block.proto=./spec --go_opt=Mp2p/proto/common.proto=./spec p2p/proto/transaction.proto p2p/proto/state.proto p2p/proto/snapshot.proto p2p/proto/common.proto p2p/proto/block.proto p2p/proto/event.proto p2p/proto/receipt.proto package starknet -// TODO: remove this nolint when the issue is fixed https://github.com/daixiang0/gci/issues/209 -//nolint:gci import ( "bytes" "context"