Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Aug 8, 2024
1 parent 5ce0f66 commit f7863c4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 22 deletions.
31 changes: 16 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
run:
tests: true
timeout: 15m
sort-results: true
allow-parallel-runners: true
exclude-dir: testutil/testdata
skip-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- "x/bank/migrations/v4/gen_state_test.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
build-tags:
- e2e
- ledger
- test_ledger_mock


linters:
disable-all: true
enable:
- depguard
- dogsled
- exportloopref
- gci
- goconst
- gocritic
- gci
- gofumpt
- gosec
- gosimple
Expand All @@ -30,13 +25,22 @@ linters:
- nakedret
- nolintlint
- staticcheck
- revive
- stylecheck
- typecheck
- unconvert
- unused

issues:
exclude-dirs:
- testutil/testdata
exclude-files:
- server/grpc/gogoreflection/fix_registration.go
- "fix_registration.go"
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.go$"
- ".*\\.pulsar\\.go$"
- crypto/keys/secp256k1/internal/*
- types/coin_regex.go
exclude-rules:
- text: "Use of weak random number generator"
linters:
Expand Down Expand Up @@ -116,11 +120,8 @@ linters-settings:
extra-rules: true
dogsled:
max-blank-identifiers: 6
maligned:
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: true
require-specific: false
gosimple:
Expand Down
1 change: 0 additions & 1 deletion server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ func startCmtNode(
node.DefaultMetricsProvider(cfg.Instrumentation),
servercmtlog.CometLoggerWrapper{Logger: svrCtx.Logger},
)

if err != nil {
return tmNode, cleanupFn, err
}
Expand Down
1 change: 0 additions & 1 deletion simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ func TestAppImportExport(t *testing.T) {
ctxA := app.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()})
ctxB := newApp.NewContextLegacy(true, cmtproto.Header{Height: app.LastBlockHeight()})
_, err = newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState)

if err != nil {
if strings.Contains(err.Error(), "validator set is empty after InitGenesis") {
logger.Info("Skipping simulation as all validators have been unbonded")
Expand Down
1 change: 0 additions & 1 deletion store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,6 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error {

return nil
}()

if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion x/distribution/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ func (k Querier) DelegatorValidators(ctx context.Context, req *types.QueryDelega
return false
},
)

if err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion x/gov/keeper/tally.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b

return false, keeper.Votes.Remove(ctx, collections.Join(vote.ProposalId, sdk.AccAddress(voter)))
})

if err != nil {
return false, false, tallyResults, err
}
Expand Down
2 changes: 0 additions & 2 deletions x/group/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,6 @@ func SimulateMsgWithdrawProposal(
}

_, _, err = app.SimDeliver(txGen.TxEncoder(), tx)

if err != nil {
if strings.Contains(err.Error(), "group was modified") || strings.Contains(err.Error(), "group policy was modified") {
return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "no-op:group/group-policy was modified"), nil, nil
Expand Down Expand Up @@ -1066,7 +1065,6 @@ func SimulateMsgVote(
}

_, _, err = app.SimDeliver(txGen.TxEncoder(), tx)

if err != nil {
if strings.Contains(err.Error(), "group was modified") || strings.Contains(err.Error(), "group policy was modified") {
return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "no-op:group/group-policy was modified"), nil, nil
Expand Down

0 comments on commit f7863c4

Please sign in to comment.