Skip to content

Add rust fmt, clippy and check running in CI #1

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

Merged
merged 5 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/rust-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Rust-Checks

on:
pull_request:
push:
branches: main

jobs:
fmt:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: ./.github/actions/install-rust-toolchain
with:
components: rustfmt

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: ./.github/actions/install-rust-toolchain
with:
components: clippy

- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets -- -D warnings
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0, MIT

//! This is the top level documentation!
#![allow(async_fn_in_trait)]

pub mod account;
pub mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/store/injected_store.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2024 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use crate::store::WalletStore;
use crate::error::Error;
use crate::store::WalletStore;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(typescript_custom_section)]
Expand Down
2 changes: 1 addition & 1 deletion src/store/memory_store.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2024 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use crate::store::WalletStore;
use crate::error::Error;
use crate::store::WalletStore;

/// A simple in-memory store for wallet data. Useful for testing
pub struct MemoryStore {
Expand Down
2 changes: 1 addition & 1 deletion tests/web_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ use webz_core::account::Account;
#[wasm_bindgen_test]
fn test_account_from_seed() {
let seed = [0; 32];
let a = Account::from_seed(&seed, 0).unwrap();
let _a = Account::from_seed(&seed, 0).unwrap();
}
Loading