Add code spellcheck CI job (#3467)

### Description

Fix spelling mistakes and create codespell CI job.
An extension of #3422 with the remaining mistakes fixed

### Backward compatibility

Yes

---------

Co-authored-by: miles <66052478+miles-six@users.noreply.github.com>
Co-authored-by: Paul Balaji <paul@hyperlane.xyz>
pull/3488/head
J M Rossy 8 months ago committed by GitHub
parent 7913d7224e
commit adab1bec0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .codespell/.codespellrc
  2. 7
      .codespell/ignore.txt
  3. 1
      .codespell/requirements.txt
  4. 35
      .github/workflows/codespell.yml
  5. 2
      CODE_OF_CONDUCT.md
  6. 2
      CONTRIBUTING.md
  7. 2
      codecov.yml
  8. 2
      rust/chains/hyperlane-cosmos/src/trait_builder.rs
  9. 2
      rust/chains/hyperlane-fuel/src/conversions.rs
  10. 2
      rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/backward.rs
  11. 2
      rust/hyperlane-base/src/contract_sync/cursors/sequence_aware/forward.rs
  12. 2
      rust/hyperlane-base/src/types/gcs_storage.rs
  13. 4
      rust/hyperlane-core/src/accumulator/merkle.rs
  14. 2
      rust/hyperlane-core/src/config/str_or_int.rs
  15. 2
      rust/hyperlane-core/src/rpc_clients/fallback.rs
  16. 2
      rust/utils/run-locally/src/cosmos/deploy.rs
  17. 2
      rust/utils/run-locally/src/solana.rs
  18. 2
      solidity/contracts/isms/ccip-read/AbstractCcipReadIsm.sol
  19. 2
      solidity/contracts/isms/hook/AbstractMessageIdAuthorizedIsm.sol
  20. 4
      solidity/contracts/isms/hook/layer-zero/LayerZeroV2Ism.sol
  21. 2
      solidity/contracts/token/extensions/HypNativeScaled.sol
  22. 6
      solidity/contracts/token/libs/FastTokenRouter.sol
  23. 2
      solidity/test/isms/OPStackIsm.t.sol
  24. 2
      solidity/test/middleware/liquidity-layer/PortalAdapter.t.sol
  25. 4
      typescript/ccip-server/src/server.ts
  26. 2
      typescript/ccip-server/src/services/LightClientService.ts
  27. 2
      typescript/infra/src/infrastructure/external-secrets/helm/README.md
  28. 2
      typescript/infra/src/utils/metrics.ts
  29. 2
      typescript/sdk/src/core/CoreDeployer.hardhat-test.ts
  30. 4
      typescript/sdk/src/core/HyperlaneCoreChecker.ts
  31. 2
      typescript/sdk/src/metadata/agentConfig.ts
  32. 6
      typescript/sdk/src/token/Token.test.ts
  33. 2
      typescript/sdk/src/token/adapters/CosmWasmTokenAdapter.ts

@ -0,0 +1,5 @@
[codespell]
skip = .git,node_modules,yarn.lock,Cargo.lock,./typescript/helloworld
count =
quiet-level = 3
ignore-words = ./.codespell/ignore.txt

@ -0,0 +1,7 @@
crate
receipient
received
receivedFrom
ser
readded
re-use

@ -0,0 +1 @@
codespell==2.2.6

@ -0,0 +1,35 @@
# A Github action that using codespell to check spelling.
# see .codespell/* for configs
# https://github.com/codespell-project/codespell
name: codespell
on:
# Triggers the workflow on push or pull request against main
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install prerequisites
run: sudo pip install -r ./.codespell/requirements.txt
- name: Spell check
run: codespell --config=./.codespell/.codespellrc

@ -13,7 +13,7 @@ This CoC applies to all members of the Hyperlane Network's community including,
3. Treat your fellow contributors with respect, fairness, and professionalism, especially in situations of high pressure.
4. Seek, offer, and accept objective critism of yours and others work, strive to acknowledge the contributions of others.
5. Be transparent and honest about your qualifications and any potential conflicts of interest. Transparency is a key tenant of the Hyperlane project and we expect it from all contributors.
6. Bring an open and curious mind, the Hyperlane project is designed to enable developers to express their curiousity, experiment, and build things we couldn't have imagined ourselves.
6. Bring an open and curious mind, the Hyperlane project is designed to enable developers to express their curiosity, experiment, and build things we couldn't have imagined ourselves.
7. Stay on track - Do your best to avoid off-topic discussion and make sure you are posting to the correct channel and repositories. Distractions are costly and it is far too easy for work to go off track.
8. Step down properly - Think of your fellow contributors when you step down from the project. Contributors of open-source projects come and go. It is crucial that when you leave the project or reduce your contribution significantly you do so in a way that minimizes disruption and keeps continuity in mind. Concretely this means telling your fellow contributors you are leaving and taking the proper steps to enable a smooth transition for other contributors to pick up where you left off.
9. Respect the privacy of others, and take extreme care to protect confidential data when you are exposed to it.

@ -1,6 +1,6 @@
# Contributing to Hyperlane
We'd love for you to contribue to Hyperlane! Here are the guidelines to follow when contributing:
We'd love for you to contribute to Hyperlane! Here are the guidelines to follow when contributing:
- [Code of Conduct](#coc)
- [Questions and Problems](#question)

@ -4,7 +4,7 @@ comment:
component_management:
default_rules: # default rules that will be inherited by all components
statuses:
- type: project # in this case every component that doens't have a status defined will have a project type one
- type: project # in this case every component that does not have a status defined will have a project type one
target: auto
branches:
- "!main"

@ -15,7 +15,7 @@ pub struct ConnectionConf {
chain_id: String,
/// The human readable address prefix for the chains using bech32.
bech32_prefix: String,
/// Canoncial Assets Denom
/// Canonical Assets Denom
canonical_asset: String,
/// The gas price set by the cosmos-sdk validator. Note that this represents the
/// minimum price set by the validator.

@ -2,7 +2,7 @@ use hyperlane_core::H256;
/// Conversion from a fuel type to H256 primitive.
pub trait FuelIntoH256 {
/// Covert to an H256 primitive.
/// Convert to an H256 primitive.
fn into_h256(self) -> H256;
}

@ -640,7 +640,7 @@ mod test {
let expected_range = 900..=1000;
assert_eq!(range, expected_range);
// Update the cursor with some paritally bogus logs:
// Update the cursor with some partially bogus logs:
// - Three logs of sequence 99, i.e. duplicated
// - A log at sequence 100, which was already indexed and should be ignored
cursor

@ -926,7 +926,7 @@ pub(crate) mod test {
let expected_range = 90..=100;
assert_eq!(range, expected_range);
// Update the cursor with some paritally bogus logs:
// Update the cursor with some partially bogus logs:
// - A log at sequence 4, which was already indexed and should be ignored
// - Three logs of sequence 5, i.e. duplicated
// - A log at sequence 6, which is unexpected, but tolerated nonetheless

@ -97,7 +97,7 @@ impl GcsStorageClientBuilder {
}
impl GcsStorageClient {
// convinience formatter
// convenience formatter
fn get_checkpoint_key(index: u32) -> String {
format!("checkpoint_{index}_with_id.json")
}

@ -14,7 +14,7 @@ use crate::{
// - remove ring dependency
// In accordance with its license terms, the apache2 license is reproduced below
// Can't initialize this using `lazy_static` because of a constaint in Solana: static variables cannot be writable.
// Can't initialize this using `lazy_static` because of a constraint in Solana: static variables cannot be writable.
// See the following links for more info:
// https://stackoverflow.com/questions/70630344/failed-to-deploy-my-solana-smart-contract
// https://docs.solana.com/developing/on-chain-programs/limitations#static-writable-data
@ -474,7 +474,7 @@ mod tests {
let leaf_b11 = H256::from([0xDD; 32]);
tree.push_leaf(leaf_b11, depth)
.expect("Pushing in outtermost leaf failed");
.expect("Pushing in outermost leaf failed");
let expected_tree = MerkleTree::create(&[leaf_b00, leaf_b01, leaf_b10, leaf_b11], depth);
assert_eq!(tree.hash(), expected_tree.hash());

@ -107,7 +107,7 @@ pub enum StrOrIntParseError {
/// The provided integer does not match the type requirements.
#[error("Provided number is an invalid integer: {0}")]
InvalidInt(#[from] TryFromIntError),
/// Some other error occured.
/// Some other error occurred.
#[error("Could not parse integer: {0}")]
Other(String),
}

@ -234,7 +234,7 @@ impl<T, B> FallbackProviderBuilder<T, B> {
}
/// Only used for testing purposes.
/// TODO: Move tests into this crate to control the visiblity with conditional compilation.
/// TODO: Move tests into this crate to control the visibility with conditional compilation.
pub fn with_max_block_time(mut self, max_block_time: Duration) -> Self {
self.max_block_time = max_block_time;
self

@ -20,7 +20,7 @@ struct IgpInstantiateMsg {
pub owner: String,
pub gas_token: String,
pub beneficiary: String,
pub default_gas_usage: String, // u128 doesnt work with cw_serde
pub default_gas_usage: String, // u128 does not work with cw_serde
}
#[cw_serde]

@ -75,7 +75,7 @@ pub fn install_solana_cli_tools() -> (PathBuf, impl ArbitraryData) {
let solana_tools_dir = tempdir().unwrap();
log!("Downloading solana cli release v{}", SOLANA_CLI_VERSION);
let solana_release_name = {
// best effort ot pick one of the supported targets
// best effort to pick one of the supported targets
let target = if cfg!(target_os = "linux") {
"x86_64-unknown-linux-gnu"
} else if cfg!(target_os = "macos") {

@ -12,7 +12,7 @@ import {AbstractMultisigIsm} from "../multisig/AbstractMultisigIsm.sol";
* @title AbstractCcipReadIsm
* @notice An ISM that allows arbitrary payloads to be submitted and verified on chain
* @dev https://eips.ethereum.org/EIPS/eip-3668
* @dev The AbstractCcipReadIsm provided by Hyperlane is left intentially minimalist as
* @dev The AbstractCcipReadIsm provided by Hyperlane is left intentionally minimalist as
* the range of applications that could be supported by a CcipReadIsm are so broad. However
* there are few things to note when building a custom CcipReadIsm.
*

@ -27,7 +27,7 @@ import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Ini
/**
* @title AbstractMessageIdAuthorizedIsm
* @notice Uses external verfication options to verify interchain messages which need a authorized caller
* @notice Uses external verification options to verify interchain messages which need a authorized caller
*/
abstract contract AbstractMessageIdAuthorizedIsm is
IInterchainSecurityModule,

@ -57,7 +57,7 @@ contract LayerZeroV2Ism is AbstractMessageIdAuthorizedIsm {
/**
* @notice Entry point for receiving msg/packet from the LayerZero endpoint.
* @param _lzMessage The payload of the received message.
* @dev Authorization verifcation is done within verifyMessageId() -> _isAuthorized()
* @dev Authorization verification is done within verifyMessageId() -> _isAuthorized()
*/
function lzReceive(
Origin calldata,
@ -83,7 +83,7 @@ contract LayerZeroV2Ism is AbstractMessageIdAuthorizedIsm {
}
/**
* @notice Validates criterias to verify a message
* @notice Validates criteria to verify a message
* @dev this is called by AbstractMessageIdAuthorizedIsm.verifyMessageId
* @dev parses msg.value to get parameters from lzReceive()
*/

@ -34,7 +34,7 @@ contract HypNativeScaled is HypNative {
}
/**
* @dev Sends scaled `_amount` (multipled by `scale`) to `_recipient`.
* @dev Sends scaled `_amount` (multiplied by `scale`) to `_recipient`.
* @inheritdoc TokenRouter
*/
function _transferTo(

@ -56,7 +56,7 @@ abstract contract FastTokenRouter is TokenRouter {
/**
* @dev allows an external user to full an unfilled fast transfer order.
* @param _recipient The recepient of the wrapped token on base chain.
* @param _recipient The recipient of the wrapped token on base chain.
* @param _amount The amount of wrapped tokens that is being bridged.
* @param _fastFee The fee the bridging entity will pay.
* @param _fastTransferId Id assigned on the remote chain to uniquely identify the transfer.
@ -131,8 +131,8 @@ abstract contract FastTokenRouter is TokenRouter {
}
/**
* @dev returns an address that indicates who should recieve the bridged tokens.
* @dev if _fastFees was inlcuded and someone filled the order before the mailbox made the contract call, the filler gets the funds.
* @dev returns an address that indicates who should receive the bridged tokens.
* @dev if _fastFees was included and someone filled the order before the mailbox made the contract call, the filler gets the funds.
*/
function _getTokenRecipient(
address _recipient,

@ -272,7 +272,7 @@ contract OPStackIsmTest is Test {
vm.selectFork(optimismFork);
// needs to be called by the cannonical messenger on Optimism
// needs to be called by the canonical messenger on Optimism
vm.expectRevert(NotCrossChainCall.selector);
opISM.verifyMessageId(messageId);

@ -60,7 +60,7 @@ contract PortalAdapterTest is Test {
function testAdapter(uint256 amount) public {
// Transfers of 0 are invalid
vm.assume(amount > 0);
// Calls MockPortalBridge with the right paramters
// Calls MockPortalBridge with the right parameters
vm.expectCall(
address(portalBridge),
abi.encodeCall(

@ -4,7 +4,7 @@ import { ProofsServiceAbi } from './abis/ProofsServiceAbi';
import * as config from './config';
import { ProofsService } from './services/ProofsService';
// Initalize Services
// Initialize Services
const proofsService = new ProofsService(
config.LIGHT_CLIENT_ADDR,
config.RPC_ADDRESS,
@ -14,7 +14,7 @@ const proofsService = new ProofsService(
config.SUCCINCT_API_KEY,
);
// Initalize Server and add Service handlers
// Initialize Server and add Service handlers
const server = new Server();
server.add(ProofsServiceAbi, [

@ -34,7 +34,7 @@ class LightClientService {
}
/**
* Calculates the slot given a timestamp, and the LightClient's configured Genesis Time and Secods Per Slot
* Calculates the slot given a timestamp, and the LightClient's configured Genesis Time and Seconds Per Slot
* @param timestamp timestamp to calculate slot with
*/
async calculateSlot(timestamp: bigint): Promise<bigint> {

@ -26,6 +26,6 @@ Regardless, workload identities are a more attractive long-term option, and movi
## What is external-secrets?
The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kuberenetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves.
The [documentation](https://external-secrets.io/v0.4.4/) is the best source. In short, it allows Kubernetes Secrets to get their secrets from an external secret provided (like GCP's Secret Manager), all without a developer/deployer needing to touch the secrets themselves.
The general idea is there are `SecretStore`s (or `ClusterSecretStore`s, which are the cluster-wide version), that specify how the cluster can authenticate with the external secret provider. `ExternalSecret`s can then be specified in "application" infrastructure, which allow developers to specify a template for a Secret that will be created using the secret values from the external provider (& using the credentials from the SecretStore).

@ -47,7 +47,7 @@ export async function submitMetrics(
* Start a simple HTTP server to host metrics. This just takes the registry and dumps the text
* string to people who request `GET /metrics`.
*
* PROMETHEUS_PORT env var is used to determine what port ot host on, defaults to 9090.
* PROMETHEUS_PORT env var is used to determine what port to host on, defaults to 9090.
*/
export function startMetricsServer(register: Registry): http.Server {
return http

@ -146,7 +146,7 @@ describe('core', async () => {
sinon.restore(); // restore normal deployer behavior and test3 will be deployed
const result = await deployer.deploy(coreConfig);
expect(result).to.have.keys(['test1', 'test2', 'test3']);
// Each test network key has entries about the other test networks, whre ISM details are stored.
// Each test network key has entries about the other test networks, where ISM details are stored.
// With this exception, the keys should be the same, so we check the intersections for equality.
const testnetKeysIntersection = Object.keys(result.test1).filter(
(key) =>

@ -113,8 +113,8 @@ export class HyperlaneCoreChecker extends HyperlaneAppChecker<
],
(bytecode) =>
// This is obviously super janky but basically we are searching
// for the ocurrences of localDomain in the bytecode and remove
// that to compare, but some coincidental ocurrences of
// for the occurrences of localDomain in the bytecode and remove
// that to compare, but some coincidental occurrences of
// localDomain in the bytecode should be not be removed which
// are just done via an offset guard
bytecode

@ -296,7 +296,7 @@ export const RelayerAgentConfigSchema = AgentConfigSchema.extend({
.optional()
.describe('The path to the relayer database.'),
relayChains: CommaSeperatedChainList.describe(
'Comma seperated list of chains to relay messages between.',
'Comma separated list of chains to relay messages between.',
),
gasPaymentEnforcement: z
.union([z.array(GasPaymentEnforcementSchema), z.string().min(1)])

@ -163,12 +163,12 @@ describe('Token', () => {
const token = new Token(tokenArgs);
expect(token.standard).to.eql(tokenArgs.standard);
const adapter = token.getAdapter(multiProvider);
const adddress =
const address =
STANDARD_TO_ADDRESS[token.standard] ??
PROTOCOL_TO_ADDRESS[token.protocol];
if (!adddress)
if (!address)
throw new Error(`No address for standard ${tokenArgs.standard}`);
const balance = await adapter.getBalance(adddress);
const balance = await adapter.getBalance(address);
expect(typeof balance).to.eql('bigint');
}
})

@ -289,7 +289,7 @@ export class CwHypSyntheticAdapter
// amount: BigInt(resp.gas_amount?.amount || 0),
// addressOrDenom: resp.gas_amount?.denom,
// };
throw new Error('CW adpater quoteTransferRemoteGas method not implemented');
throw new Error('CW adapter quoteTransferRemoteGas method not implemented');
}
async populateTransferRemoteTx({

Loading…
Cancel
Save