Skip to content

Commit

Permalink
chore: Update golangci-lint to version 1.61.0 (NethermindEth#2154)
Browse files Browse the repository at this point in the history
* chore: Update golangci-lint to version 1.61.0

* chore: Exclude G115 from gosec linter

Exclude G115 from the gosec linter to address the issue with securego/gosec#1212.

* chore: Remove unused variable assignments

Remove unused variable assignments in node/node.go and utils/pipeline/pipeline_test.go files.

* chore: Remove unused nolint directives

Remove unused nolint directives in the starknet client.go and handlers.go files.
  • Loading branch information
AnkushinDaniil committed Sep 24, 2024
1 parent 2de650f commit f49b97d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 11 deletions.
10 changes: 6 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -75,7 +79,7 @@ linters:
- dogsled
- dupl
- errcheck
- exportloopref
- copyloopvar
- funlen
- gochecknoinits
- goconst
Expand Down Expand Up @@ -108,14 +112,12 @@ linters:

# don't enable:
# - asciicheck
# - scopelint
# - gochecknoglobals
# - gocognit
# - godot
# - godox
# - goerr113
# - err113
# - interfacer
# - maligned
# - nestif
# - prealloc
# - testpackage
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions p2p/starknet/client.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 0 additions & 2 deletions p2p/starknet/handlers.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 0 additions & 1 deletion utils/pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f49b97d

Please sign in to comment.