From 0314c6bc90cd7758e3fca51de759a956db0a5daf Mon Sep 17 00:00:00 2001 From: Vritra4 Date: Fri, 15 Nov 2024 12:07:31 +0900 Subject: [PATCH] add spellcheck and run --- .github/config/.codespellignore | 11 +++++++++ .github/workflows/spellcheck.yml | 28 +++++++++++++++++++++++ Dockerfile.arm64 | 2 +- app/ibc-hooks/README.md | 2 +- app/keepers/keepers.go | 2 +- contrib/devtools/Makefile | 4 ++-- integration-tests/erc721_transfer_test.go | 10 ++++---- jsonrpc/namespaces/eth/api.go | 2 +- x/evm/contracts/i_cosmos/ICosmos.sol | 2 +- x/evm/keeper/context.go | 2 +- x/evm/keeper/context_test.go | 4 ++-- 11 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 .github/config/.codespellignore create mode 100644 .github/workflows/spellcheck.yml diff --git a/.github/config/.codespellignore b/.github/config/.codespellignore new file mode 100644 index 00000000..a08537a9 --- /dev/null +++ b/.github/config/.codespellignore @@ -0,0 +1,11 @@ +cips +pullrequest +keypair +pastTime +hasTables +Nam +EyT +upTo +initia +minitia +expRes diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 00000000..3c9e159f --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,28 @@ +name: Spell Check + +on: + pull_request: + +jobs: + spellcheck: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Run codespell + continue-on-error: true + run: | + sudo apt-get install codespell -y + codespell -w --skip="*.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,go.sum,go.work.sum,go.mod,statik.go,*.map,swagger.yaml" --ignore-words=.github/config/.codespellignore + - uses: peter-evans/create-pull-request@v7.0.5 + if: github.event_name != 'pull_request' + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "chore: fix typos" + title: "chore: fix typos" + branch: "chore/fix-typos" + delete-branch: true + body: | + This PR fixes typos in the codebase. + Please review it, and merge if everything is fine. + If there are proto changes, run `make proto-gen` and commit the changes. diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 9099da77..10551ba2 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -3,7 +3,7 @@ FROM arm64v8/golang:1.22-bullseye AS go-builder # Install minimum necessary dependencies, build Cosmos SDK, remove packages RUN apt update RUN apt install -y curl git build-essential ca-certificates -# debug: for live editting in the image +# debug: for live editing in the image RUN apt install -y vim WORKDIR /code diff --git a/app/ibc-hooks/README.md b/app/ibc-hooks/README.md index a355b335..52562e96 100644 --- a/app/ibc-hooks/README.md +++ b/app/ibc-hooks/README.md @@ -92,7 +92,7 @@ msg := MsgCall{ ### ICS20 packet structure -So given the details above, we propogate the implied ICS20 packet data structure. +So given the details above, we propagate the implied ICS20 packet data structure. ICS20 is JSON native, so we use JSON for the memo format. ```json diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index e7366b94..89a88aa5 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -235,7 +235,7 @@ func NewAppKeeper( appKeepers.OracleKeeper = &oracleKeeper // Add the oracle keeper as a hook to market map keeper so new market map entries can be created - // and propogated to the oracle keeper. + // and propagated to the oracle keeper. appKeepers.MarketMapKeeper.SetHooks(appKeepers.OracleKeeper.Hooks()) appKeepers.OPChildKeeper = opchildkeeper.NewKeeper( diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile index 489114f4..fc8834ee 100644 --- a/contrib/devtools/Makefile +++ b/contrib/devtools/Makefile @@ -57,7 +57,7 @@ tools-stamp: statik runsim touch $@ # Install the runsim binary with a temporary workaround of entering an outside -# directory as the "go install" command ignores the -mod option and will polute the +# directory as the "go install" command ignores the -mod option and will pollute the # go.{mod, sum} files. # # ref: https://github.com/golang/go/issues/30515 @@ -67,7 +67,7 @@ $(STATIK): @(cd /tmp && go install github.com/rakyll/statik@v0.1.6) # Install the runsim binary with a temporary workaround of entering an outside -# directory as the "go install" command ignores the -mod option and will polute the +# directory as the "go install" command ignores the -mod option and will pollute the # go.{mod, sum} files. # # ref: https://github.com/golang/go/issues/30515 diff --git a/integration-tests/erc721_transfer_test.go b/integration-tests/erc721_transfer_test.go index fea8fff5..309c2bdd 100644 --- a/integration-tests/erc721_transfer_test.go +++ b/integration-tests/erc721_transfer_test.go @@ -71,11 +71,11 @@ func (suite *KeeperTestSuite) convertAppToMApp(chain *ibctesting.TestChain) { genBals[i] = balance } - mapp := minievmapp.SetupWithGenesisAccounts(chain.Vals.Copy(), genAccs, genBals...) - baseapp.SetChainID(chain.ChainID)(mapp.GetBaseApp()) - chain.App = mapp - chain.Codec = mapp.AppCodec() - chain.TxConfig = mapp.TxConfig() + map := minievmapp.SetupWithGenesisAccounts(chain.Vals.Copy(), genAccs, genBals...) + baseapp.SetChainID(chain.ChainID)(map.GetBaseApp()) + chain.App = map + chain.Codec = map.AppCodec() + chain.TxConfig = map.TxConfig() chain.CurrentHeader = cmtproto.Header{ ChainID: chain.ChainID, diff --git a/jsonrpc/namespaces/eth/api.go b/jsonrpc/namespaces/eth/api.go index 549bdd50..9b9a6635 100644 --- a/jsonrpc/namespaces/eth/api.go +++ b/jsonrpc/namespaces/eth/api.go @@ -411,7 +411,7 @@ func (api *EthAPI) GetUncleCountByBlockNumber(_ rpc.BlockNumber) hexutil.Uint { } // ************************************* -// * pow(leagcy) * +// * pow(legacy) * // ************************************* // Hashrate returns the current node's hashrate. Always 0. diff --git a/x/evm/contracts/i_cosmos/ICosmos.sol b/x/evm/contracts/i_cosmos/ICosmos.sol index 0bff08f4..75b7368c 100644 --- a/x/evm/contracts/i_cosmos/ICosmos.sol +++ b/x/evm/contracts/i_cosmos/ICosmos.sol @@ -91,7 +91,7 @@ interface ICosmos { Options memory options ) external returns (bool dummy); - // query a whitelisted cosmos querys. + // query a whitelisted cosmos queries. // // example) // path: "/connect.oracle.v2.Query/GetPrices" diff --git a/x/evm/keeper/context.go b/x/evm/keeper/context.go index ba01b8d0..0243ed46 100644 --- a/x/evm/keeper/context.go +++ b/x/evm/keeper/context.go @@ -519,7 +519,7 @@ func (k Keeper) dispatchMessage(parentCtx sdk.Context, request types.ExecuteRequ // emit submessage event parentCtx.EventManager().EmitEvent(event) - // if callback exists, execute it with parent context becuase it's already committed + // if callback exists, execute it with parent context because it's already committed if callbackId > 0 { inputBz, err := k.cosmosCallbackABI.Pack("callback", callbackId, success) if err != nil { diff --git a/x/evm/keeper/context_test.go b/x/evm/keeper/context_test.go index 0748457f..f174d9da 100644 --- a/x/evm/keeper/context_test.go +++ b/x/evm/keeper/context_test.go @@ -198,7 +198,7 @@ func Test_GetHash(t *testing.T) { require.Equal(t, hash100, [32]byte(queryRes)) require.Empty(t, logs) - // vaild query + // valid query queryInputBz, err = parsed.Pack("get_blockhash", uint64(101)) require.NoError(t, err) @@ -207,7 +207,7 @@ func Test_GetHash(t *testing.T) { require.Equal(t, hash101, [32]byte(queryRes)) require.Empty(t, logs) - // vaild query + // valid query queryInputBz, err = parsed.Pack("get_blockhash", uint64(356)) require.NoError(t, err)