From bf773785f28e1276a12553dbcbabd164e83362b3 Mon Sep 17 00:00:00 2001 From: Rano | Ranadeep Date: Tue, 14 Nov 2023 11:51:48 -0500 Subject: [PATCH] ci: spell check on GitHub workflows (#964) * typos github action * cutom config for typos * fix spelling to counterparty * fix spelling to transfer --- .github/typos.toml | 3 +++ .github/workflows/typos.yml | 13 ++++++++++++ .../transfer/relay/send_transfer.rs | 2 +- .../ics03_connection/msgs/conn_open_init.rs | 20 +++++++++---------- .../core/ics04_channel/msgs/chan_open_init.rs | 20 +++++++++---------- 5 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 .github/typos.toml create mode 100644 .github/workflows/typos.yml diff --git a/.github/typos.toml b/.github/typos.toml new file mode 100644 index 000000000..fc71242c0 --- /dev/null +++ b/.github/typos.toml @@ -0,0 +1,3 @@ +[default.extend-words] +# for serde serialization +ser = "ser" diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 000000000..ba30dc387 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,13 @@ +name: Spell Check +on: + pull_request: + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: crate-ci/typos@master + with: + config: ./.github/typos.toml diff --git a/crates/ibc/src/applications/transfer/relay/send_transfer.rs b/crates/ibc/src/applications/transfer/relay/send_transfer.rs index 607457f48..112462cd0 100644 --- a/crates/ibc/src/applications/transfer/relay/send_transfer.rs +++ b/crates/ibc/src/applications/transfer/relay/send_transfer.rs @@ -28,7 +28,7 @@ where send_transfer_execute(send_packet_ctx_a, token_ctx_a, msg) } -/// Validates the token tranfer. If this succeeds, then it is legal to initiate the transfer with [`send_transfer_execute`]. +/// Validates the token transfer. If this succeeds, then it is legal to initiate the transfer with [`send_transfer_execute`]. pub fn send_transfer_validate( send_packet_ctx_a: &SendPacketCtx, token_ctx_a: &TokenCtx, diff --git a/crates/ibc/src/core/ics03_connection/msgs/conn_open_init.rs b/crates/ibc/src/core/ics03_connection/msgs/conn_open_init.rs index 249076364..d0fd2572a 100644 --- a/crates/ibc/src/core/ics03_connection/msgs/conn_open_init.rs +++ b/crates/ibc/src/core/ics03_connection/msgs/conn_open_init.rs @@ -208,24 +208,24 @@ mod tests { // Check if handler sets counterparty connection id to `None` // in case relayer passes `MsgConnectionOpenInit` message with it set to `Some(_)`. - let raw_with_counterpary_conn_id_some = dummy_raw_msg_conn_open_init(); - let msg_with_counterpary_conn_id_some = - MsgConnectionOpenInit::try_from(raw_with_counterpary_conn_id_some).unwrap(); - let raw_with_counterpary_conn_id_some_back = - RawMsgConnectionOpenInit::from(msg_with_counterpary_conn_id_some.clone()); - let msg_with_counterpary_conn_id_some_back = - MsgConnectionOpenInit::try_from(raw_with_counterpary_conn_id_some_back.clone()) + let raw_with_counterparty_conn_id_some = dummy_raw_msg_conn_open_init(); + let msg_with_counterparty_conn_id_some = + MsgConnectionOpenInit::try_from(raw_with_counterparty_conn_id_some).unwrap(); + let raw_with_counterparty_conn_id_some_back = + RawMsgConnectionOpenInit::from(msg_with_counterparty_conn_id_some.clone()); + let msg_with_counterparty_conn_id_some_back = + MsgConnectionOpenInit::try_from(raw_with_counterparty_conn_id_some_back.clone()) .unwrap(); assert_eq!( - raw_with_counterpary_conn_id_some_back + raw_with_counterparty_conn_id_some_back .counterparty .unwrap() .connection_id, "".to_string() ); assert_eq!( - msg_with_counterpary_conn_id_some, - msg_with_counterpary_conn_id_some_back + msg_with_counterparty_conn_id_some, + msg_with_counterparty_conn_id_some_back ); } diff --git a/crates/ibc/src/core/ics04_channel/msgs/chan_open_init.rs b/crates/ibc/src/core/ics04_channel/msgs/chan_open_init.rs index c9bc91718..9f68c475e 100644 --- a/crates/ibc/src/core/ics04_channel/msgs/chan_open_init.rs +++ b/crates/ibc/src/core/ics04_channel/msgs/chan_open_init.rs @@ -162,15 +162,15 @@ mod tests { // Check if handler sets counterparty channel id to `None` // in case relayer passes `MsgChannelOpenInit` message with it set to `Some(_)` - let raw_with_counterpary_chan_id_some = dummy_raw_msg_chan_open_init(None); - let msg_with_counterpary_chan_id_some = - MsgChannelOpenInit::try_from(raw_with_counterpary_chan_id_some).unwrap(); - let raw_with_counterpary_chan_id_some_back = - RawMsgChannelOpenInit::from(msg_with_counterpary_chan_id_some.clone()); - let msg_with_counterpary_chan_id_some_back = - MsgChannelOpenInit::try_from(raw_with_counterpary_chan_id_some_back.clone()).unwrap(); + let raw_with_counterparty_chan_id_some = dummy_raw_msg_chan_open_init(None); + let msg_with_counterparty_chan_id_some = + MsgChannelOpenInit::try_from(raw_with_counterparty_chan_id_some).unwrap(); + let raw_with_counterparty_chan_id_some_back = + RawMsgChannelOpenInit::from(msg_with_counterparty_chan_id_some.clone()); + let msg_with_counterparty_chan_id_some_back = + MsgChannelOpenInit::try_from(raw_with_counterparty_chan_id_some_back.clone()).unwrap(); assert_eq!( - raw_with_counterpary_chan_id_some_back + raw_with_counterparty_chan_id_some_back .channel .unwrap() .counterparty @@ -179,8 +179,8 @@ mod tests { "".to_string() ); assert_eq!( - msg_with_counterpary_chan_id_some, - msg_with_counterpary_chan_id_some_back + msg_with_counterparty_chan_id_some, + msg_with_counterparty_chan_id_some_back ); } }