Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faddat/pebble lint remove tools #1238

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- `[p2p]` Correctly use non-blocking `TrySendEnvelope` method when attempting to
send messages, as opposed to the blocking `SendEnvelope` method. It is unclear
whether this has a meaningful impact on P2P performance, but this patch does
correct the underlying behaviour to what it should be
correct the underlying behavior to what it should be
([tendermint/tendermint\#9936](https://github.com/tendermint/tendermint/pull/9936))
110 changes: 82 additions & 28 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,82 @@
run:
tests: true
timeout: 10m
skip-files:
- libs/pubsub/query/query.peg.go

linters:
enable:
- asciicheck
- bodyclose
enable-all: true
disable:
- containedctx
- contextcheck
- cyclop
- depguard
- dogsled
- dupl
- errcheck
- exportloopref
- goconst
- gofmt
- goimports
- deadcode
- dupword
- errname
- errorlint
- exhaustive
- exhaustivestruct
- exhaustruct
- forbidigo
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- gocyclo
- godox
- goerr113
- golint
- gomnd
- ifshort
- interfacebloat
- interfacer
- inamedparam
- ireturn
- lll
- maintidx
- maligned
- nestif
- nilnil
- nlreturn
- nonamedreturns
- nosnakecase
- paralleltest
- perfsprint
- predeclared
- revive
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nolintlint
- prealloc
- staticcheck
# - structcheck // to be fixed by golangci-lint
- stylecheck
- typecheck
- unconvert
- unused
- scopelint
- structcheck
- tagliatelle
- testpackage
- testifylint
- varcheck
- varnamelen
- wastedassign
- wrapcheck
- wsl

issues:
exclude-rules:
- path: _test\.go
linters:
- gocritic
- gofmt
- goimport
- gosec
max-same-issues: 50
- noctx
- paralleltest
- testpackage
- tparallel
- path: \.pb\.go
linters:
- gofmt
- goimports
- govet
- stylecheck
max-same-issues: 10000
max-issues-per-linter: 10000

linters-settings:
dogsled:
Expand All @@ -40,7 +85,16 @@ linters-settings:
min-confidence: 0
maligned:
suggest-new: true
misspell:
locale: US
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # blank imports
- dot # dot imports
- prefix(github.com/tendermint/tendermint, github.com/cometbft/cometbft-db)
custom-order: true



run:
skip-files:
- libs/pubsub/query/query.peg.go
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ to this release!
- `[p2p]` Correctly use non-blocking `TrySendEnvelope` method when attempting to
send messages, as opposed to the blocking `SendEnvelope` method. It is unclear
whether this has a meaningful impact on P2P performance, but this patch does
correct the underlying behaviour to what it should be
correct the underlying behavior to what it should be
([tendermint/tendermint\#9936](https://github.com/tendermint/tendermint/pull/9936))

### DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion DOCKER/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use a build arg to ensure that both stages use the same,
# hopefully current, go version.
ARG GOLANG_BASE_IMAGE=golang:1.19-alpine
ARG GOLANG_BASE_IMAGE=golang:1.22-alpine

# stage 1 Generate CometBFT Binary
FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder
Expand Down
2 changes: 1 addition & 1 deletion abci/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type Client interface {
//----------------------------------------

// NewClient returns a new ABCI client of the specified transport type.
// It returns an error if the transport is not "socket" or "grpc"
// It returns an error if the transport is not "socket" or "grpc".
func NewClient(addr, transport string, mustConnect bool) (client Client, err error) {
switch transport {
case "socket":
Expand Down
14 changes: 6 additions & 8 deletions abci/client/grpc_client.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package abcicli

import (
"context"
"fmt"
"net"
"sync"
"time"

"context"

"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"

Expand All @@ -20,7 +19,7 @@ import (
var _ Client = (*grpcClient)(nil)

// A stripped copy of the remoteClient that makes
// synchronous calls using grpc
// synchronous calls using grpc.
type grpcClient struct {
service.BaseService
mustConnect bool
Expand Down Expand Up @@ -304,7 +303,6 @@ func (cli *grpcClient) ApplySnapshotChunkAsync(params types.RequestApplySnapshot
func (cli *grpcClient) PrepareProposalAsync(
params types.RequestPrepareProposal,
) *ReqRes {

req := types.ToRequestPrepareProposal(params)
res, err := cli.client.PrepareProposal(context.Background(), req.GetPrepareProposal(), grpc.WaitForReady(true))
if err != nil {
Expand All @@ -323,7 +321,6 @@ func (cli *grpcClient) PrepareProposalAsync(
func (cli *grpcClient) ProcessProposalAsync(
params types.RequestProcessProposal,
) *ReqRes {

req := types.ToRequestProcessProposal(params)
res, err := cli.client.ProcessProposal(context.Background(), req.GetProcessProposal(), grpc.WaitForReady(true))
if err != nil {
Expand Down Expand Up @@ -447,21 +444,22 @@ func (cli *grpcClient) OfferSnapshotSync(params types.RequestOfferSnapshot) (*ty
}

func (cli *grpcClient) LoadSnapshotChunkSync(
params types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
params types.RequestLoadSnapshotChunk,
) (*types.ResponseLoadSnapshotChunk, error) {
reqres := cli.LoadSnapshotChunkAsync(params)
return cli.finishSyncCall(reqres).GetLoadSnapshotChunk(), cli.Error()
}

func (cli *grpcClient) ApplySnapshotChunkSync(
params types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
params types.RequestApplySnapshotChunk,
) (*types.ResponseApplySnapshotChunk, error) {
reqres := cli.ApplySnapshotChunkAsync(params)
return cli.finishSyncCall(reqres).GetApplySnapshotChunk(), cli.Error()
}

func (cli *grpcClient) PrepareProposalSync(
params types.RequestPrepareProposal,
) (*types.ResponsePrepareProposal, error) {

reqres := cli.PrepareProposalAsync(params)
return cli.finishSyncCall(reqres).GetPrepareProposal(), cli.Error()
}
Expand Down
7 changes: 4 additions & 3 deletions abci/client/local_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ func (app *localClient) OfferSnapshotSync(req types.RequestOfferSnapshot) (*type
}

func (app *localClient) LoadSnapshotChunkSync(
req types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) {
req types.RequestLoadSnapshotChunk,
) (*types.ResponseLoadSnapshotChunk, error) {
app.mtx.Lock()
defer app.mtx.Unlock()

Expand All @@ -341,7 +342,8 @@ func (app *localClient) LoadSnapshotChunkSync(
}

func (app *localClient) ApplySnapshotChunkSync(
req types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) {
req types.RequestApplySnapshotChunk,
) (*types.ResponseApplySnapshotChunk, error) {
app.mtx.Lock()
defer app.mtx.Unlock()

Expand All @@ -352,7 +354,6 @@ func (app *localClient) ApplySnapshotChunkSync(
func (app *localClient) PrepareProposalSync(
req types.RequestPrepareProposal,
) (*types.ResponsePrepareProposal, error) {

app.mtx.Lock()
defer app.mtx.Unlock()

Expand Down
Loading
Loading