diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9b97890..8d9fea77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,26 @@ jobs: - name: Lint Client Rust run: pnpm clients:rust:lint + spellcheck_rust: + name: Spellcheck Rust + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - name: Setup Environment + uses: ./.github/actions/setup + with: + cargo-cache-key: cargo-spellcheck + + - name: Install cargo-spellcheck + uses: taiki-e/install-action@v2 + with: + tool: cargo-spellcheck + + - name: Run cargo-spellcheck + run: pnpm rust:spellcheck + build_programs: name: Build programs runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index dea04efe..af1f5d42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,6 @@ solana = "2.1.0" [workspace.metadata.toolchains] format = "nightly-2024-08-08" lint = "nightly-2024-08-08" + +[workspace.metadata.spellcheck] +config = "scripts/spellcheck.toml" diff --git a/package.json b/package.json index 31139f50..9e70d669 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "clients:rust:lint": "zx ./scripts/client/lint-rust.mjs", "clients:rust:publish": "zx ./scripts/client/publish-rust.mjs", "clients:rust:test": "zx ./scripts/client/test-rust.mjs", - "template:upgrade": "zx ./scripts/upgrade-template.mjs" + "template:upgrade": "zx ./scripts/upgrade-template.mjs", + "rust:spellcheck": "cargo spellcheck --code 1" }, "devDependencies": { "@codama/renderers-js": "^1.1.0", diff --git a/program/src/lib.rs b/program/src/lib.rs index 898167a7..02df4b69 100644 --- a/program/src/lib.rs +++ b/program/src/lib.rs @@ -18,7 +18,7 @@ use { solana_pubkey::Pubkey, }; -/// Legacy symbols from Memo v1 +/// Legacy symbols from Memo version 1 pub mod v1 { solana_pubkey::declare_id!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo"); } @@ -29,7 +29,7 @@ solana_pubkey::declare_id!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"); /// /// Accounts expected by this instruction: /// -/// 0. ..0+N. `[signer]` Expected signers; if zero provided, instruction will +/// 0. `..0+N` `[signer]` Expected signers; if zero provided, instruction will /// be processed as a normal, unsigned spl-memo pub fn build_memo(memo: &[u8], signer_pubkeys: &[&Pubkey]) -> Instruction { Instruction { diff --git a/scripts/solana.dic b/scripts/solana.dic new file mode 100644 index 00000000..2530ee1a --- /dev/null +++ b/scripts/solana.dic @@ -0,0 +1,51 @@ +1000 +config +metadata +json +uri +ui +cli +readme/S +arg/S +vec/S +enum/S +noop/S +realloc/S +overallocate/SGD +namespace +serde +deserialize/SRGD +deserialization +struct/S +param/S +tuple/S +metas +infos +async +subcommand +repo +init +solana +sol/S +blockchain/S +permissionless +composability +runtime +onchain +offchain +keypair/S +decrypt/SGD +lamport/S +validator/S +pubkey/S +sysvar/S +timestamp/S +entrypoint/S +spl +pda/S +multisignature/S +multisig/S +staker/S +APY +codama +autogenerated diff --git a/scripts/spellcheck.toml b/scripts/spellcheck.toml new file mode 100644 index 00000000..67d80b07 --- /dev/null +++ b/scripts/spellcheck.toml @@ -0,0 +1,6 @@ +[Hunspell] +use_builtin = true +skip_os_lookups = false +search_dirs = ["."] +extra_dictionaries = ["solana.dic"] +