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

style: Improve code quality with new linters (backport #1414) #1426

Closed
wants to merge 2 commits into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jun 18, 2024

Description

closes: #XXXX

New linter list
- asasalint
- asciicheck
- bidichk
- bodyclose
- copyloopvar
- errchkjson
- errorlint
- tenv
- wastedassign
- fatcontext

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

This is an automatic backport of pull request #1414 done by [Mergify](https://mergify.com).

* Use golangci-lint v1.59

* Bump golangci-lint ci from 1.55 to 1.59

* Add useful linters

* Apply copyloopvar

* Apply errchkjson, tenv

* Apply `wastedassign`

* Apply `errorlint`

(cherry picked from commit d60e44a)

# Conflicts:
#	.golangci.yml
#	CHANGELOG.md
#	Makefile
#	server/oc_cmds_test.go
#	server/util_test.go
#	x/foundation/client/testutil/tx.go
Copy link
Contributor Author

mergify bot commented Jun 18, 2024

Cherry-pick of d60e44a has failed:

On branch mergify/bp/release/v0.49.x/pr-1414
Your branch is up to date with 'origin/release/v0.49.x'.

You are currently cherry-picking commit d60e44aa6.
  (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:   baseapp/abci_test.go
	modified:   baseapp/deliver_tx_test.go
	modified:   client/cmd_test.go
	modified:   client/config/cmd.go
	modified:   client/config/config.go
	modified:   client/config/config_test.go
	modified:   client/debug/main.go
	modified:   client/flags/flags_test.go
	modified:   client/grpc/tmservice/service_test.go
	modified:   client/keys/add_ledger_test.go
	modified:   client/keys/add_test.go
	modified:   client/keys/codec_test.go
	modified:   client/keys/list_test.go
	modified:   client/keys/parse_test.go
	modified:   client/keys/show.go
	modified:   client/keys/show_test.go
	modified:   client/tx/tx_test.go
	modified:   client/utils_test.go
	modified:   codec/amino_codec_test.go
	modified:   codec/codec_common_test.go
	modified:   codec/proto_codec_test.go
	modified:   codec/unknownproto/unit_helpers_test.go
	modified:   codec/unknownproto/unknown_fields_test.go
	modified:   crypto/armor.go
	modified:   crypto/hd/hdpath_test.go
	modified:   crypto/keyring/keyring.go
	modified:   crypto/keyring/signing_algorithms_test.go
	modified:   crypto/keys/multisig/codec.go
	modified:   crypto/keys/secp256k1/secp256k1_internal_test.go
	modified:   crypto/keys/secp256k1/secp256k1_test.go
	modified:   crypto/ledger/ledger_mock.go
	modified:   crypto/ledger/ledger_secp256k1.go
	modified:   crypto/types/compact_bit_array_test.go
	modified:   server/export.go
	modified:   server/grpc/gogoreflection/serverreflection.go
	modified:   server/pruning_test.go
	modified:   server/start.go
	modified:   server/util.go
	modified:   simapp/genesis_account_test.go
	modified:   simapp/sim_bench_test.go
	modified:   simapp/simd/cmd/genaccounts_test.go
	modified:   simapp/simd/cmd/root_test.go
	modified:   simapp/simd/main.go
	modified:   simapp/utils_test.go
	modified:   snapshots/chunk.go
	modified:   snapshots/helpers_test.go
	modified:   store/cachekv/search_test.go
	modified:   store/iavl/store_test.go
	modified:   store/rootmulti/snapshot_test.go
	modified:   store/rootmulti/store.go
	modified:   store/rootmulti/store_test.go
	modified:   store/types/gas_test.go
	modified:   store/types/iterator_test.go
	modified:   store/types/store_test.go
	modified:   types/address/store_key_test.go
	modified:   types/address_test.go
	modified:   types/coin_test.go
	modified:   types/context_test.go
	modified:   types/dec_coin.go
	modified:   types/dec_coin_test.go
	modified:   types/decimal.go
	modified:   types/decimal_internal_test.go
	modified:   types/decimal_test.go
	modified:   types/errors/abci_test.go
	modified:   types/events_test.go
	modified:   types/int.go
	modified:   types/int_test.go
	modified:   types/simulation/account_test.go
	modified:   types/simulation/rand_util_test.go
	modified:   types/uint.go
	modified:   types/uint_test.go
	modified:   types/utils_test.go
	modified:   x/auth/ante/basic_test.go
	modified:   x/auth/ante/sigverify.go
	modified:   x/auth/client/testutil/suite.go
	modified:   x/auth/client/tx.go
	modified:   x/auth/client/tx_test.go
	modified:   x/auth/legacy/v043/store_test.go
	modified:   x/auth/simulation/decoder_test.go
	modified:   x/auth/tx/encode_decode_test.go
	modified:   x/auth/tx/service_test.go
	modified:   x/auth/types/account_test.go
	modified:   x/auth/types/params_test.go
	modified:   x/auth/types/permissions_test.go
	modified:   x/auth/vesting/client/testutil/suite.go
	modified:   x/auth/vesting/handler_test.go
	modified:   x/auth/vesting/types/vesting_account_test.go
	modified:   x/authz/client/testutil/grpc.go
	modified:   x/authz/client/testutil/query.go
	modified:   x/authz/client/testutil/tx.go
	modified:   x/authz/simulation/decoder_test.go
	modified:   x/bank/client/testutil/grpc.go
	modified:   x/bank/client/testutil/suite.go
	modified:   x/bank/keeper/genesis.go
	modified:   x/bank/keeper/genesis_test.go
	modified:   x/bank/keeper/keeper.go
	modified:   x/bank/types/balance_test.go
	modified:   x/bank/types/genesis_test.go
	modified:   x/bank/types/key_test.go
	modified:   x/bank/types/metadata_test.go
	modified:   x/bank/types/params_test.go
	modified:   x/bankplus/keeper/keeper_test.go
	modified:   x/capability/simulation/decoder_test.go
	modified:   x/capability/types/genesis_test.go
	modified:   x/collection/client/testutil/query.go
	modified:   x/collection/client/testutil/tx.go
	modified:   x/collection/msgs_test.go
	modified:   x/crisis/client/testsuite/suite.go
	modified:   x/crisis/handler_test.go
	modified:   x/distribution/client/common/common_test.go
	modified:   x/distribution/client/testutil/grpc.go
	modified:   x/distribution/client/testutil/suite.go
	modified:   x/distribution/keeper/allocation_test.go
	modified:   x/distribution/legacy/v043/store_test.go
	modified:   x/distribution/simulation/decoder_test.go
	modified:   x/distribution/types/params_internal_test.go
	modified:   x/evidence/client/testutil/suite.go
	modified:   x/evidence/simulation/decoder_test.go
	modified:   x/evidence/types/evidence_test.go
	modified:   x/fbridge/keeper/transfer.go
	modified:   x/fbridge/types/msgs_test.go
	modified:   x/feegrant/client/testutil/suite.go
	modified:   x/feegrant/grant_test.go
	modified:   x/feegrant/keeper/genesis_test.go
	modified:   x/feegrant/keeper/keeper_test.go
	modified:   x/feegrant/simulation/decoder_test.go
	modified:   x/feegrant/types/grant_test.go
	modified:   x/foundation/client/testutil/grpc.go
	modified:   x/foundation/client/testutil/query.go
	modified:   x/foundation/keeper/internal/keeper_test.go
	modified:   x/foundation/keeper/internal/proposal.go
	modified:   x/foundation/msgs_test.go
	modified:   x/fswap/client/testutil/grpc.go
	modified:   x/fswap/client/testutil/query.go
	modified:   x/fswap/client/testutil/tx.go
	modified:   x/fswap/types/msgs_test.go
	modified:   x/genutil/client/cli/init_test.go
	modified:   x/genutil/client/testutil/helpers.go
	modified:   x/genutil/client/testutil/migrate.go
	modified:   x/genutil/client/testutil/suite.go
	modified:   x/genutil/client/testutil/validate_genesis.go
	modified:   x/genutil/utils_test.go
	modified:   x/gov/client/cli/query.go
	modified:   x/gov/client/testutil/grpc.go
	modified:   x/gov/client/testutil/suite.go
	modified:   x/gov/client/utils/query_test.go
	modified:   x/gov/genesis_test.go
	modified:   x/gov/keeper/deposit_test.go
	modified:   x/gov/keeper/querier_test.go
	modified:   x/gov/legacy/v043/store_test.go
	modified:   x/gov/simulation/decoder_test.go
	modified:   x/gov/simulation/operations.go
	modified:   x/gov/types/proposal.go
	modified:   x/gov/types/vote.go
	modified:   x/mint/client/testutil/grpc.go
	modified:   x/mint/client/testutil/suite.go
	modified:   x/mint/simulation/decoder_test.go
	modified:   x/params/client/testutil/grpc.go
	modified:   x/params/client/testutil/suite.go
	modified:   x/params/keeper/keeper_test.go
	modified:   x/params/proposal_handler_test.go
	modified:   x/params/types/subspace.go
	modified:   x/params/types/subspace_test.go
	modified:   x/simulation/operation.go
	modified:   x/slashing/client/testutil/grpc.go
	modified:   x/slashing/client/testutil/suite.go
	modified:   x/slashing/legacy/v043/store_test.go
	modified:   x/slashing/simulation/decoder_test.go
	modified:   x/staking/client/cli/query.go
	modified:   x/staking/client/cli/tx.go
	modified:   x/staking/client/cli/tx_test.go
	modified:   x/staking/client/testutil/grpc.go
	modified:   x/staking/client/testutil/suite.go
	modified:   x/staking/genesis_test.go
	modified:   x/staking/handler_test.go
	modified:   x/staking/keeper/delegation_test.go
	modified:   x/staking/keeper/slash.go
	modified:   x/staking/legacy/v043/store_test.go
	modified:   x/staking/simulation/decoder_test.go
	modified:   x/staking/types/authz_test.go
	modified:   x/token/client/testutil/query.go
	modified:   x/token/client/testutil/tx.go
	modified:   x/token/msgs_test.go
	modified:   x/upgrade/keeper/keeper_test.go
	modified:   x/upgrade/types/plan_test.go
	modified:   x/upgrade/types/proposal_test.go
	modified:   x/upgrade/types/storeloader_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   .golangci.yml
	both modified:   CHANGELOG.md
	both modified:   Makefile
	both modified:   server/oc_cmds_test.go
	both modified:   server/util_test.go
	both modified:   x/foundation/client/testutil/tx.go

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

@mergify mergify bot added the conflicts label Jun 18, 2024
@tkxkd0159 tkxkd0159 self-assigned this Jun 18, 2024
@tkxkd0159 tkxkd0159 closed this Jun 18, 2024
@mergify mergify bot deleted the mergify/bp/release/v0.49.x/pr-1414 branch June 18, 2024 16: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