Skip to content

Fix lints (backport #625) - #647

Merged
thanethomson merged 2 commits into
v0.38.xfrom
mergify/bp/v0.38.x/pr-625
Apr 5, 2023
Merged

thanethomson merged 2 commits into
v0.38.xfrom
mergify/bp/v0.38.x/pr-625

Conversation

@mergify

@mergify mergify Bot commented Apr 5, 2023

Copy link
Copy Markdown
Contributor

This is an automatic backport of pull request #625 done by Mergify.
Cherry-pick of 111d252 has failed:

On branch mergify/bp/v0.38.x/pr-625
Your branch is up to date with 'origin/v0.38.x'.

You are currently cherry-picking commit 111d252d7.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .github/workflows/lint.yml
	modified:   Makefile
	modified:   abci/client/grpc_client.go
	modified:   abci/client/grpc_client_test.go
	modified:   abci/client/socket_client.go
	modified:   abci/client/socket_client_test.go
	modified:   abci/cmd/abci-cli/abci-cli.go
	modified:   abci/example/kvstore/helpers.go
	modified:   abci/example/kvstore/kvstore.go
	modified:   abci/example/kvstore/kvstore_test.go
	modified:   abci/server/grpc_server.go
	modified:   abci/tests/server/client.go
	modified:   abci/types/application.go
	modified:   blocksync/pool.go
	modified:   blocksync/reactor.go
	modified:   cmd/cometbft/commands/debug/kill.go
	modified:   cmd/cometbft/commands/gen_node_key.go
	modified:   cmd/cometbft/commands/gen_validator.go
	modified:   cmd/cometbft/commands/init.go
	modified:   cmd/cometbft/commands/inspect.go
	modified:   cmd/cometbft/commands/light.go
	modified:   cmd/cometbft/commands/probe_upnp.go
	modified:   cmd/cometbft/commands/reset.go
	modified:   cmd/cometbft/commands/root.go
	modified:   cmd/cometbft/commands/root_test.go
	modified:   cmd/cometbft/commands/show_node_id.go
	modified:   cmd/cometbft/commands/show_validator.go
	modified:   cmd/cometbft/commands/testnet.go
	modified:   consensus/byzantine_test.go
	modified:   consensus/invalid_test.go
	modified:   consensus/reactor.go
	modified:   consensus/reactor_test.go
	modified:   consensus/replay_stubs.go
	modified:   consensus/replay_test.go
	modified:   consensus/state_test.go
	modified:   consensus/types/height_vote_set_test.go
	modified:   consensus/wal.go
	modified:   consensus/wal_generator.go
	modified:   evidence/verify.go
	modified:   inspect/inspect.go
	modified:   inspect/inspect_test.go
	modified:   internal/test/validator.go
	modified:   libs/autofile/cmd/logjack.go
	modified:   libs/bits/bit_array_test.go
	modified:   libs/cli/setup.go
	modified:   libs/clist/clist.go
	modified:   libs/json/helpers_test.go
	modified:   libs/protoio/io_test.go
	modified:   libs/rand/random.go
	modified:   libs/rand/random_test.go
	modified:   libs/strings/string.go
	modified:   light/provider/mock/deadmock.go
	modified:   mempool/clist_mempool.go
	modified:   mempool/clist_mempool_test.go
	modified:   mempool/reactor.go
	modified:   node/node.go
	modified:   node/setup.go
	modified:   p2p/base_reactor.go
	modified:   p2p/conn/connection.go
	modified:   p2p/conn/secret_connection_test.go
	modified:   p2p/mock/peer.go
	modified:   p2p/mock/reactor.go
	modified:   p2p/peer_set_test.go
	modified:   p2p/pex/pex_reactor.go
	modified:   p2p/pex/pex_reactor_test.go
	modified:   p2p/switch_test.go
	modified:   p2p/test_util.go
	modified:   p2p/upnp/upnp.go
	modified:   privval/signer_client_test.go
	modified:   rpc/client/http/http.go
	modified:   rpc/client/local/local.go
	modified:   rpc/client/mock/client.go
	modified:   rpc/client/mock/status.go
	modified:   rpc/core/dev.go
	modified:   rpc/core/net_test.go
	modified:   rpc/grpc/api.go
	modified:   rpc/grpc/client_server.go
	modified:   rpc/jsonrpc/jsonrpc_test.go
	modified:   rpc/jsonrpc/server/http_json_handler_test.go
	modified:   rpc/jsonrpc/test/main.go
	modified:   scripts/metricsgen/metricsgen.go
	modified:   state/helpers_test.go
	modified:   state/indexer/block/kv/util.go
	modified:   state/indexer/block/null/null.go
	modified:   state/indexer/sink/psql/backport.go
	modified:   state/indexer/sink/psql/psql.go
	modified:   state/services.go
	modified:   state/state_test.go
	modified:   state/txindex/kv/kv_test.go
	modified:   state/txindex/kv/utils.go
	modified:   state/txindex/null/null.go
	modified:   statesync/reactor.go
	modified:   statesync/reactor_test.go
	modified:   statesync/syncer_test.go
	modified:   store/store_test.go
	modified:   test/e2e/app/app.go
	modified:   test/e2e/generator/generate.go
	modified:   test/e2e/runner/evidence.go
	modified:   test/e2e/runner/main.go
	modified:   types/event_bus.go
	modified:   types/priv_validator.go
	modified:   types/protobuf_test.go
	modified:   types/validator_set.go
	modified:   types/validator_set_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   consensus/state.go
	both modified:   rpc/core/abci.go
	both modified:   rpc/core/blocks.go
	both modified:   rpc/core/consensus.go
	both modified:   rpc/core/evidence.go
	both modified:   rpc/core/health.go
	both modified:   rpc/core/mempool.go
	both modified:   rpc/core/net.go
	both modified:   rpc/core/status.go
	both modified:   rpc/core/tx.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

This touches a large number of files, but I believe it's necessary as part of our tech debt cleanup. There are so many functions littering the codebase where:

1. We have unused parameters and they should have been refactored away, but they weren't
2. We have unused parameters and they should be named according to proper Go conventions (e.g. in interface implementations where a particular function signature is required, but the variable names should either be left out or `_` when unused)
3. We have redundant code (a whole bunch of redundant `if` statements and error checks, for example)
4. We use bad naming conventions for variables, like `copy` or `len`

I'm also tired of having the linter fail locally. And if we don't do this, it will all just rot even more.

This PR targets `main`, but should be applied across all the backport branches (which will, of course, require some conflict resolution, but I'm fine with doing that). I've left TODOs in some places where changes need to be made in follow-up PRs.

Commits are organized by package so that it's hopefully easier to review.

If you pick up on formatting changes, please see #604.

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments

(cherry picked from commit 111d252)

# Conflicts:
#	consensus/state.go
#	rpc/core/abci.go
#	rpc/core/blocks.go
#	rpc/core/consensus.go
#	rpc/core/evidence.go
#	rpc/core/health.go
#	rpc/core/mempool.go
#	rpc/core/net.go
#	rpc/core/status.go
#	rpc/core/tx.go
@mergify
mergify Bot requested a review from a team as a code owner April 5, 2023 10:56
@mergify mergify Bot added the conflicts label Apr 5, 2023
Signed-off-by: Thane Thomson <[email protected]>
@thanethomson
thanethomson merged commit 3098d5f into v0.38.x Apr 5, 2023
@thanethomson
thanethomson deleted the mergify/bp/v0.38.x/pr-625 branch April 5, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant